Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1d158695
Kaydet (Commit)
1d158695
authored
Haz 18, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Markup consistency nits.
üst
cf70ea63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
89 deletions
+43
-89
api.tex
Doc/api/api.tex
+43
-89
No files found.
Doc/api/api.tex
Dosyayı görüntüle @
1d158695
...
@@ -1175,11 +1175,11 @@ For internal use only.
...
@@ -1175,11 +1175,11 @@ For internal use only.
For internal use only.
For internal use only.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyImport
_
ImportFrozenModule
}{
char *
}
\begin{cfuncdesc}
{
int
}{
PyImport
_
ImportFrozenModule
}{
char *
name
}
Load a frozen module
. Return
\code
{
1
}
for success,
\code
{
0
}
if the
Load a frozen module
named
\var
{
name
}
. Return
\code
{
1
}
for success,
module is not found, and
\code
{
-1
}
with an exception set if the
\code
{
0
}
if the module is not found, and
\code
{
-1
}
with an exception
initialization failed. To access the imported module on a successful
set if the initialization failed. To access the imported module on a
load, use
\cfunction
{
PyImport
_
ImportModule()
}
.
successful
load, use
\cfunction
{
PyImport
_
ImportModule()
}
.
(Note the misnomer --- this function would reload the module if it was
(Note the misnomer --- this function would reload the module if it was
already imported.)
already imported.)
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2057,7 +2057,7 @@ undefined. It is the user's responsibility to fill in the needed data.
...
@@ -2057,7 +2057,7 @@ undefined. It is the user's responsibility to fill in the needed data.
The buffer is copied into the new object.
The buffer is copied into the new object.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
Py
_
UNICODE
*
}{
PyUnicode
_
AsUnicode
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
Py
_
UNICODE*
}{
PyUnicode
_
AsUnicode
}{
PyObject *unicode
}
Return a read-only pointer to the Unicode object's internal
Return a read-only pointer to the Unicode object's internal
\ctype
{
Py
_
UNICODE
}
buffer.
\ctype
{
Py
_
UNICODE
}
buffer.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2102,7 +2102,6 @@ given size. Returns \NULL{} on failure.
...
@@ -2102,7 +2102,6 @@ given size. Returns \NULL{} on failure.
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
AsWideChar
}{
PyUnicodeObject *unicode,
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
AsWideChar
}{
PyUnicodeObject *unicode,
wchar
_
t *w,
wchar
_
t *w,
int size
}
int size
}
Copies the Unicode Object contents into the
\ctype
{
whcar
_
t
}
buffer
Copies the Unicode Object contents into the
\ctype
{
whcar
_
t
}
buffer
\var
{
w
}
. At most
\var
{
size
}
\ctype
{
whcar
_
t
}
characters are copied.
\var
{
w
}
. At most
\var
{
size
}
\ctype
{
whcar
_
t
}
characters are copied.
Returns the number of
\ctype
{
whcar
_
t
}
characters copied or -1 in case
Returns the number of
\ctype
{
whcar
_
t
}
characters copied or -1 in case
...
@@ -2138,7 +2137,6 @@ These are the generic codec APIs:
...
@@ -2138,7 +2137,6 @@ These are the generic codec APIs:
int size,
int size,
const char *encoding,
const char *encoding,
const char *errors
}
const char *errors
}
Create a Unicode object by decoding
\var
{
size
}
bytes of the encoded
Create a Unicode object by decoding
\var
{
size
}
bytes of the encoded
string
\var
{
s
}
.
\var
{
encoding
}
and
\var
{
errors
}
have the same meaning
string
\var
{
s
}
.
\var
{
encoding
}
and
\var
{
errors
}
have the same meaning
as the parameters of the same name in the unicode() builtin
as the parameters of the same name in the unicode() builtin
...
@@ -2151,7 +2149,6 @@ codec.
...
@@ -2151,7 +2149,6 @@ codec.
int size,
int size,
const char *encoding,
const char *encoding,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size and returns a
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size and returns a
Python string object.
\var
{
encoding
}
and
\var
{
errors
}
have the same
Python string object.
\var
{
encoding
}
and
\var
{
errors
}
have the same
meaning as the parameters of the same name in the Unicode .encode()
meaning as the parameters of the same name in the Unicode .encode()
...
@@ -2163,7 +2160,6 @@ codec.
...
@@ -2163,7 +2160,6 @@ codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsEncodedString
}{
PyObject *unicode,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsEncodedString
}{
PyObject *unicode,
const char *encoding,
const char *encoding,
const char *errors
}
const char *errors
}
Encodes a Unicode object and returns the result as Python string
Encodes a Unicode object and returns the result as Python string
object.
\var
{
encoding
}
and
\var
{
errors
}
have the same meaning as the
object.
\var
{
encoding
}
and
\var
{
errors
}
have the same meaning as the
parameters of the same name in the Unicode .encode() method. The codec
parameters of the same name in the Unicode .encode() method. The codec
...
@@ -2178,7 +2174,6 @@ These are the UTF-8 codec APIs:
...
@@ -2178,7 +2174,6 @@ These are the UTF-8 codec APIs:
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeUTF8
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeUTF8
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the UTF-8
Creates a Unicode object by decoding
\var
{
size
}
bytes of the UTF-8
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
raised by the codec.
raised by the codec.
...
@@ -2187,14 +2182,12 @@ raised by the codec.
...
@@ -2187,14 +2182,12 @@ raised by the codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeUTF8
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeUTF8
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using UTF-8
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using UTF-8
and returns a Python string object. Returns
\NULL
{}
in case an
and returns a Python string object. Returns
\NULL
{}
in case an
exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsUTF8String
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsUTF8String
}{
PyObject *unicode
}
Encodes a Unicode objects using UTF-8 and returns the result as Python
Encodes a Unicode objects using UTF-8 and returns the result as Python
string object. Error handling is ``strict''. Returns
string object. Error handling is ``strict''. Returns
\NULL
{}
in case an exception was raised by the codec.
\NULL
{}
in case an exception was raised by the codec.
...
@@ -2208,7 +2201,6 @@ These are the UTF-16 codec APIs:
...
@@ -2208,7 +2201,6 @@ These are the UTF-16 codec APIs:
int size,
int size,
const char *errors,
const char *errors,
int *byteorder
}
int *byteorder
}
Decodes
\var
{
length
}
bytes from a UTF-16 encoded buffer string and
Decodes
\var
{
length
}
bytes from a UTF-16 encoded buffer string and
returns the corresponding Unicode object.
returns the corresponding Unicode object.
...
@@ -2238,7 +2230,6 @@ Returns \NULL{} in case an exception was raised by the codec.
...
@@ -2238,7 +2230,6 @@ Returns \NULL{} in case an exception was raised by the codec.
int size,
int size,
const char *errors,
const char *errors,
int byteorder
}
int byteorder
}
Returns a Python string object holding the UTF-16 encoded value of the
Returns a Python string object holding the UTF-16 encoded value of the
Unicode data in
\var
{
s
}
.
Unicode data in
\var
{
s
}
.
...
@@ -2276,7 +2267,6 @@ These are the ``Unicode Esacpe'' codec APIs:
...
@@ -2276,7 +2267,6 @@ These are the ``Unicode Esacpe'' codec APIs:
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeUnicodeEscape
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeUnicodeEscape
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Unicode-Esacpe
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Unicode-Esacpe
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
raised by the codec.
raised by the codec.
...
@@ -2285,14 +2275,12 @@ raised by the codec.
...
@@ -2285,14 +2275,12 @@ raised by the codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeUnicodeEscape
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeUnicodeEscape
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Unicode-Escape
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Unicode-Escape
and returns a Python string object. Returns
\NULL
{}
in case an
and returns a Python string object. Returns
\NULL
{}
in case an
exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsUnicodeEscapeString
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsUnicodeEscapeString
}{
PyObject *unicode
}
Encodes a Unicode objects using Unicode-Escape and returns the result
Encodes a Unicode objects using Unicode-Escape and returns the result
as Python string object. Error handling is ``strict''. Returns
as Python string object. Error handling is ``strict''. Returns
\NULL
{}
in case an exception was raised by the codec.
\NULL
{}
in case an exception was raised by the codec.
...
@@ -2305,7 +2293,6 @@ These are the ``Raw Unicode Esacpe'' codec APIs:
...
@@ -2305,7 +2293,6 @@ These are the ``Raw Unicode Esacpe'' codec APIs:
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeRawUnicodeEscape
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeRawUnicodeEscape
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Raw-Unicode-Esacpe
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Raw-Unicode-Esacpe
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
raised by the codec.
raised by the codec.
...
@@ -2314,14 +2301,12 @@ raised by the codec.
...
@@ -2314,14 +2301,12 @@ raised by the codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeRawUnicodeEscape
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeRawUnicodeEscape
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Raw-Unicode-Escape
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Raw-Unicode-Escape
and returns a Python string object. Returns
\NULL
{}
in case an
and returns a Python string object. Returns
\NULL
{}
in case an
exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsRawUnicodeEscapeString
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsRawUnicodeEscapeString
}{
PyObject *unicode
}
Encodes a Unicode objects using Raw-Unicode-Escape and returns the result
Encodes a Unicode objects using Raw-Unicode-Escape and returns the result
as Python string object. Error handling is ``strict''. Returns
as Python string object. Error handling is ``strict''. Returns
\NULL
{}
in case an exception was raised by the codec.
\NULL
{}
in case an exception was raised by the codec.
...
@@ -2335,25 +2320,22 @@ Latin-1 corresponds to the first 256 Unicode ordinals and only these
...
@@ -2335,25 +2320,22 @@ Latin-1 corresponds to the first 256 Unicode ordinals and only these
are accepted by the codecs during encoding.
are accepted by the codecs during encoding.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeLatin1
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeLatin1
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Latin-1
Creates a Unicode object by decoding
\var
{
size
}
bytes of the Latin-1
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
raised by the codec.
raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeLatin1
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeLatin1
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Latin-1
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using Latin-1
and returns a Python string object. Returns
\NULL
{}
in case an
and returns a Python string object. Returns
\NULL
{}
in case an
exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsLatin1String
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsLatin1String
}{
PyObject *unicode
}
Encodes a Unicode objects using Latin-1 and returns the result as
Encodes a Unicode objects using Latin-1 and returns the result as
Python string object. Error handling is ``strict''. Returns
Python string object. Error handling is ``strict''. Returns
\NULL
{}
in case an exception was raised by the codec.
\NULL
{}
in case an exception was raised by the codec.
...
@@ -2361,31 +2343,27 @@ Python string object. Error handling is ``strict''. Returns
...
@@ -2361,31 +2343,27 @@ Python string object. Error handling is ``strict''. Returns
% --- ASCII Codecs -------------------------------------------------------
% --- ASCII Codecs -------------------------------------------------------
These are the ASCII codec APIs:
These are the
\ASCII
{}
codec APIs. Only 7-bit
\ASCII
{}
data is
accepted. All other codes generate errors.
Only 7-bit ASCII data is excepted. All other codes generate errors.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeASCII
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeASCII
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the
Creates a Unicode object by decoding
\var
{
size
}
bytes of the ASCII
\ASCII
{}
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
was raised by the codec.
raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeASCII
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeASCII
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using ASCII
\ASCII
{}
and returns a Python string object. Returns
\NULL
{}
in case
and returns a Python string object. Returns
\NULL
{}
in case an
an exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsASCIIString
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsASCIIString
}{
PyObject *unicode
}
Encodes a Unicode objects using
\ASCII
{}
and returns the result as Python
Encodes a Unicode objects using ASCII and returns the result as Python
string object. Error handling is ``strict''. Returns
string object. Error handling is ``strict''. Returns
\NULL
{}
in case an exception was raised by the codec.
\NULL
{}
in case an exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2420,7 +2398,6 @@ points.
...
@@ -2420,7 +2398,6 @@ points.
int size,
int size,
PyObject *mapping,
PyObject *mapping,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the encoded
Creates a Unicode object by decoding
\var
{
size
}
bytes of the encoded
string
\var
{
s
}
using the given
\var
{
mapping
}
object. Returns
\NULL
{}
string
\var
{
s
}
using the given
\var
{
mapping
}
object. Returns
\NULL
{}
in case an exception was raised by the codec.
in case an exception was raised by the codec.
...
@@ -2430,7 +2407,6 @@ in case an exception was raised by the codec.
...
@@ -2430,7 +2407,6 @@ in case an exception was raised by the codec.
int size,
int size,
PyObject *mapping,
PyObject *mapping,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using the
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using the
given
\var
{
mapping
}
object and returns a Python string object.
given
\var
{
mapping
}
object and returns a Python string object.
Returns
\NULL
{}
in case an exception was raised by the codec.
Returns
\NULL
{}
in case an exception was raised by the codec.
...
@@ -2438,7 +2414,6 @@ Returns \NULL{} in case an exception was raised by the codec.
...
@@ -2438,7 +2414,6 @@ Returns \NULL{} in case an exception was raised by the codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsCharmapString
}{
PyObject *unicode,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsCharmapString
}{
PyObject *unicode,
PyObject *mapping
}
PyObject *mapping
}
Encodes a Unicode objects using the given
\var
{
mapping
}
object and
Encodes a Unicode objects using the given
\var
{
mapping
}
object and
returns the result as Python string object. Error handling is
returns the result as Python string object. Error handling is
``strict''. Returns
\NULL
{}
in case an exception was raised by the
``strict''. Returns
\NULL
{}
in case an exception was raised by the
...
@@ -2451,10 +2426,10 @@ The following codec API is special in that maps Unicode to Unicode.
...
@@ -2451,10 +2426,10 @@ The following codec API is special in that maps Unicode to Unicode.
int size,
int size,
PyObject *table,
PyObject *table,
const char *errors
}
const char *errors
}
Translates a
\ctype
{
Py
_
UNICODE
}
buffer of the given length by applying
Translates a
\ctype
{
Py
_
UNICODE
}
buffer of the given length by applying
a character mapping
\var
{
table
}
to it and returns the resulting
a character mapping
\var
{
table
}
to it and returns the resulting
Unicode object.
Unicode object. Returns
\NULL
{}
when an exception was raised by the
codec.
The
\var
{
mapping
}
table must map Unicode ordinal integers to Unicode
The
\var
{
mapping
}
table must map Unicode ordinal integers to Unicode
ordinal integers or None (causing deletion of the character).
ordinal integers or None (causing deletion of the character).
...
@@ -2462,43 +2437,36 @@ ordinal integers or None (causing deletion of the character).
...
@@ -2462,43 +2437,36 @@ ordinal integers or None (causing deletion of the character).
Mapping tables must only provide the
__
getitem
__
interface,
Mapping tables must only provide the
__
getitem
__
interface,
e.g. dictionaries or sequences. Unmapped character ordinals (ones
e.g. dictionaries or sequences. Unmapped character ordinals (ones
which cause a LookupError) are left untouched and are copied as-is.
which cause a LookupError) are left untouched and are copied as-is.
Returns
\NULL
{}
in case an exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
% --- MBCS codecs for Windows --------------------------------------------
% --- MBCS codecs for Windows --------------------------------------------
These are the MBCS codec APIs. They are currently only available
These are the MBCS codec APIs. They are currently only available
on
Windows and use the Win32 MBCS converters to implement the
Windows and use the Win32 MBCS converters to implement the
conversions.
conversions. Note that MBCS (or DBCS) is a class of encodings, not
just one. The target encoding is defined by the user settings on the
Note that MBCS (or DBCS) is a class of encodings, not just one. The
machine running the codec.
target encoding is defined by the user settings on the machine running
the codec.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeMBCS
}{
const char *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
DecodeMBCS
}{
const char *s,
int size,
int size,
const char *errors
}
const char *errors
}
Creates a Unicode object by decoding
\var
{
size
}
bytes of the MBCS
Creates a Unicode object by decoding
\var
{
size
}
bytes of the MBCS
encoded string
\var
{
s
}
. Returns
\NULL
{}
in case an exception was
encoded string
\var
{
s
}
.
Returns
\NULL
{}
in case an exception was
raised by the codec.
raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeMBCS
}{
const Py
_
UNICODE *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
EncodeMBCS
}{
const Py
_
UNICODE *s,
int size,
int size,
const char *errors
}
const char *errors
}
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using MBCS
Encodes the
\ctype
{
Py
_
UNICODE
}
buffer of the given size using MBCS
and returns a Python string object. Returns
\NULL
{}
in case an
and returns a Python string object. Returns
\NULL
{}
in case an
exception was raised by the codec.
exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsMBCSString
}{
PyObject *unicode
}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
AsMBCSString
}{
PyObject *unicode
}
Encodes a Unicode objects using MBCS and returns the result as Python
Encodes a Unicode objects using MBCS and returns the result as Python
string object.
Error handling is ``strict''. Returns
string object.
Error handling is ``strict''. Returns
\NULL
{}
in case
\NULL
{}
in case
an exception was raised by the codec.
an exception was raised by the codec.
\end{cfuncdesc}
\end{cfuncdesc}
% --- Methods & Slots ----------------------------------------------------
% --- Methods & Slots ----------------------------------------------------
...
@@ -2513,14 +2481,12 @@ They all return \NULL{} or -1 in case an exception occurrs.
...
@@ -2513,14 +2481,12 @@ They all return \NULL{} or -1 in case an exception occurrs.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Concat
}{
PyObject *left,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Concat
}{
PyObject *left,
PyObject *right
}
PyObject *right
}
Concat two strings giving a new Unicode string.
Concat two strings giving a new Unicode string.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Split
}{
PyObject *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Split
}{
PyObject *s,
PyObject *sep,
PyObject *sep,
int maxsplit
}
int maxsplit
}
Split a string giving a list of Unicode strings.
Split a string giving a list of Unicode strings.
If sep is NULL, splitting will be done at all whitespace
If sep is NULL, splitting will be done at all whitespace
...
@@ -2533,17 +2499,14 @@ Separators are not included in the resulting list.
...
@@ -2533,17 +2499,14 @@ Separators are not included in the resulting list.
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Splitlines
}{
PyObject *s,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Splitlines
}{
PyObject *s,
int maxsplit
}
int maxsplit
}
Split a Unicode string at line breaks, returning a list of Unicode
Dito, but split at line breaks.
strings. CRLF is considered to be one line break. The Line break
characters are not included in the resulting strings.
CRLF is considered to be one line break. Line breaks are not
included in the resulting list.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Translate
}{
PyObject *str,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Translate
}{
PyObject *str,
PyObject *table,
PyObject *table,
const char *errors
}
const char *errors
}
Translate a string by applying a character mapping table to it and
Translate a string by applying a character mapping table to it and
return the resulting Unicode object.
return the resulting Unicode object.
...
@@ -2556,12 +2519,10 @@ which cause a LookupError) are left untouched and are copied as-is.
...
@@ -2556,12 +2519,10 @@ which cause a LookupError) are left untouched and are copied as-is.
\var
{
errors
}
has the usual meaning for codecs. It may be
\NULL
{}
\var
{
errors
}
has the usual meaning for codecs. It may be
\NULL
{}
which indicates to use the default error handling.
which indicates to use the default error handling.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Join
}{
PyObject *separator,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Join
}{
PyObject *separator,
PyObject *seq
}
PyObject *seq
}
Join a sequence of strings using the given separator and return
Join a sequence of strings using the given separator and return
the resulting Unicode string.
the resulting Unicode string.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2571,7 +2532,6 @@ the resulting Unicode string.
...
@@ -2571,7 +2532,6 @@ the resulting Unicode string.
int start,
int start,
int end,
int end,
int direction
}
int direction
}
Return 1 if
\var
{
substr
}
matches
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
] at
Return 1 if
\var
{
substr
}
matches
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
] at
the given tail end (
\var
{
direction
}
== -1 means to do a prefix match,
the given tail end (
\var
{
direction
}
== -1 means to do a prefix match,
\var
{
direction
}
== 1 a suffix match), 0 otherwise.
\var
{
direction
}
== 1 a suffix match), 0 otherwise.
...
@@ -2582,7 +2542,6 @@ the given tail end (\var{direction} == -1 means to do a prefix match,
...
@@ -2582,7 +2542,6 @@ the given tail end (\var{direction} == -1 means to do a prefix match,
int start,
int start,
int end,
int end,
int direction
}
int direction
}
Return the first position of
\var
{
substr
}
in
Return the first position of
\var
{
substr
}
in
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
] using the given
\var
{
direction
}
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
] using the given
\var
{
direction
}
(
\var
{
direction
}
== 1 means to do a forward search,
(
\var
{
direction
}
== 1 means to do a forward search,
...
@@ -2593,7 +2552,6 @@ Return the first position of \var{substr} in
...
@@ -2593,7 +2552,6 @@ Return the first position of \var{substr} in
PyObject *substr,
PyObject *substr,
int start,
int start,
int end
}
int end
}
Count the number of occurrences of
\var
{
substr
}
in
Count the number of occurrences of
\var
{
substr
}
in
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
]
\var
{
str
}
[
\var
{
start
}
:
\var
{
end
}
]
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2602,33 +2560,29 @@ Count the number of occurrences of \var{substr} in
...
@@ -2602,33 +2560,29 @@ Count the number of occurrences of \var{substr} in
PyObject *substr,
PyObject *substr,
PyObject *replstr,
PyObject *replstr,
int maxcount
}
int maxcount
}
Replace at most
\var
{
maxcount
}
occurrences of
\var
{
substr
}
in
Replace at most
\var
{
maxcount
}
occurrences of
\var
{
substr
}
in
\var
{
str
}
with
\var
{
replstr
}
and return the resulting Unicode object.
\var
{
str
}
with
\var
{
replstr
}
and return the resulting Unicode object.
\var
{
maxcount
}
== -1 means: replace all occurrences.
\var
{
maxcount
}
== -1 means: replace all occurrences.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
Compare
}{
PyObject *left,
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
Compare
}{
PyObject *left, PyObject *right
}
PyObject *right
}
Compare two strings and return -1, 0, 1 for less than, equal,
Compare two strings and return -1, 0, 1 for less than, equal,
greater than resp.
greater than resp.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Format
}{
PyObject *format,
\begin{cfuncdesc}
{
PyObject*
}{
PyUnicode
_
Format
}{
PyObject *format,
PyObject *args
}
PyObject *args
}
Returns a new string object from
\var
{
format
}
and
\var
{
args
}
. Analogou
s
Returns a new string object from
\var
{
format
}
and
\var
{
args
}
; this i
s
to
\code
{
\var
{
format
}
\%
\var
{
args
}}
. The
\var
{
args
}
argument must b
e
analogous to
\code
{
\var
{
format
}
\%\ \var
{
args
}}
. Th
e
a tuple.
\var
{
args
}
argument must be
a tuple.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
Contains
}{
PyObject *container,
\begin{cfuncdesc}
{
int
}{
PyUnicode
_
Contains
}{
PyObject *container,
PyObject *element
}
PyObject *element
}
Checks whether
\var
{
element
}
is contained in
\var
{
container
}
and
Checks whether
\var
{
element
}
is contained in
\var
{
container
}
and
returns
1/0
accordingly.
returns
true or false
accordingly.
\var
{
element
}
has to coerce to a
n one element Unicode string. -1
is
\var
{
element
}
has to coerce to a
one element Unicode string.
\code
{
-1
}
is
returned in case of an error.
returned in case of an error.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -2970,7 +2924,7 @@ raised.
...
@@ -2970,7 +2924,7 @@ raised.
char *key,
char *key,
PyObject *val
}
PyObject *val
}
Inserts
\var
{
value
}
into the dictionary using
\var
{
key
}
Inserts
\var
{
value
}
into the dictionary using
\var
{
key
}
as a key.
\var
{
key
}
should be a
\ctype
{
char
*
}
. The key object is
as a key.
\var
{
key
}
should be a
\ctype
{
char*
}
. The key object is
created using
\code
{
PyString
_
FromString(
\var
{
key
}
)
}
.
created using
\code
{
PyString
_
FromString(
\var
{
key
}
)
}
.
\ttindex
{
PyString
_
FromString()
}
\ttindex
{
PyString
_
FromString()
}
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -3447,7 +3401,7 @@ Returns true if its argument is a \ctype{PyCObject}.
...
@@ -3447,7 +3401,7 @@ Returns true if its argument is a \ctype{PyCObject}.
\begin{cfuncdesc}
{
PyObject*
}{
PyCObject
_
FromVoidPtr
}{
void* cobj,
\begin{cfuncdesc}
{
PyObject*
}{
PyCObject
_
FromVoidPtr
}{
void* cobj,
void (*destr)(void *)
}
void (*destr)(void *)
}
Creates a
\ctype
{
PyCObject
}
from the
\code
{
void *
}
\var
{
cobj
}
. The
Creates a
\ctype
{
PyCObject
}
from the
\code
{
void *
}
\var
{
cobj
}
. The
\var
{
destr
}
function will be called when the object is reclaimed, unless
\var
{
destr
}
function will be called when the object is reclaimed, unless
it is
\NULL
.
it is
\NULL
.
\end{cfuncdesc}
\end{cfuncdesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment