~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/c-api/string.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
called with a non-string parameter.
10
10
 
11
11
.. note::
12
 
   These functions have been renamed to PyBytes_* in Python 3.x. The PyBytes
13
 
   names are also available in 2.6.
 
12
 
 
13
   These functions have been renamed to PyBytes_* in Python 3.x. Unless
 
14
   otherwise noted, the PyBytes functions available in 3.x are aliased to their
 
15
   PyString_* equivalents to help porting.
14
16
 
15
17
.. index:: object: string
16
18
 
238
240
   reference-count-neutral; you own the object after the call if and only if you
239
241
   owned it before the call.)
240
242
 
 
243
   .. note::
 
244
 
 
245
      This function is not available in 3.x and does not have a PyBytes alias.
 
246
 
241
247
 
242
248
.. cfunction:: PyObject* PyString_InternFromString(const char *v)
243
249
 
246
252
   been interned, or a new ("owned") reference to an earlier interned string object
247
253
   with the same value.
248
254
 
 
255
   .. note::
 
256
 
 
257
      This function is not available in 3.x and does not have a PyBytes alias.
 
258
 
249
259
 
250
260
.. cfunction:: PyObject* PyString_Decode(const char *s, Py_ssize_t size, const char *encoding, const char *errors)
251
261
 
255
265
   The codec to be used is looked up using the Python codec registry.  Return
256
266
   *NULL* if an exception was raised by the codec.
257
267
 
 
268
   .. note::
 
269
 
 
270
      This function is not available in 3.x and does not have a PyBytes alias.
 
271
 
258
272
   .. versionchanged:: 2.5
259
273
      This function used an :ctype:`int` type for *size*. This might require
260
274
      changes in your code for properly supporting 64-bit systems.
268
282
   The codec to be used is looked up using the Python codec registry. Return *NULL*
269
283
   if an exception was raised by the codec.
270
284
 
 
285
   .. note::
 
286
 
 
287
      This function is not available in 3.x and does not have a PyBytes alias.
 
288
 
271
289
 
272
290
.. cfunction:: PyObject* PyString_Encode(const char *s, Py_ssize_t size, const char *encoding, const char *errors)
273
291
 
277
295
   :meth:`encode` method. The codec to be used is looked up using the Python codec
278
296
   registry.  Return *NULL* if an exception was raised by the codec.
279
297
 
 
298
   .. note::
 
299
 
 
300
      This function is not available in 3.x and does not have a PyBytes alias.
 
301
 
280
302
   .. versionchanged:: 2.5
281
303
      This function used an :ctype:`int` type for *size*. This might require
282
304
      changes in your code for properly supporting 64-bit systems.
289
311
   parameters of the same name in the string :meth:`encode` method. The codec to be
290
312
   used is looked up using the Python codec registry. Return *NULL* if an exception
291
313
   was raised by the codec.
 
314
 
 
315
   .. note::
 
316
 
 
317
      This function is not available in 3.x and does not have a PyBytes alias.