Kaydet (Commit) a2074f0b authored tarafından Guido van Rossum's avatar Guido van Rossum

Kill PyString_Encode(), which isn't used anywhere.

(We should also kill the other PyString_ encode/decode APIs, but they
still have some users.)
üst 35d02c16
...@@ -874,15 +874,6 @@ called with a non-string parameter. ...@@ -874,15 +874,6 @@ called with a non-string parameter.
if an exception was raised by the codec. if an exception was raised by the codec.
.. cfunction:: PyObject* PyString_Encode(const char *s, Py_ssize_t size, const char *encoding, const char *errors)
Encode the :ctype:`char` buffer of the given size by passing it to the codec
registered for *encoding* and return a Python object. *encoding* and *errors*
have the same meaning as the parameters of the same name in the string
:meth:`encode` method. The codec to be used is looked up using the Python codec
registry. Return *NULL* if an exception was raised by the codec.
.. cfunction:: PyObject* PyString_AsEncodedObject(PyObject *str, const char *encoding, const char *errors) .. cfunction:: PyObject* PyString_AsEncodedObject(PyObject *str, const char *encoding, const char *errors)
Encode a string object using the codec registered for *encoding* and return the Encode a string object using the codec registered for *encoding* and return the
......
...@@ -70,7 +70,7 @@ PyAPI_FUNC(int) _PyString_Eq(PyObject *, PyObject*); ...@@ -70,7 +70,7 @@ PyAPI_FUNC(int) _PyString_Eq(PyObject *, PyObject*);
PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*, int, int, PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*, int, int,
int, char**, int*); int, char**, int*);
PyAPI_FUNC(PyObject *) PyString_DecodeEscape(const char *, Py_ssize_t, PyAPI_FUNC(PyObject *) PyString_DecodeEscape(const char *, Py_ssize_t,
const char *, Py_ssize_t, const char *, Py_ssize_t,
const char *); const char *);
...@@ -102,17 +102,7 @@ PyAPI_FUNC(PyObject*) PyString_Decode( ...@@ -102,17 +102,7 @@ PyAPI_FUNC(PyObject*) PyString_Decode(
const char *errors /* error handling */ const char *errors /* error handling */
); );
/* Encodes a char buffer of the given size and returns a /* Encodes a string object and returns the result as Python
Python object. */
PyAPI_FUNC(PyObject*) PyString_Encode(
const char *s, /* string char buffer */
Py_ssize_t size, /* number of chars to encode */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Encodes a string object and returns the result as Python
object. */ object. */
PyAPI_FUNC(PyObject*) PyString_AsEncodedObject( PyAPI_FUNC(PyObject*) PyString_AsEncodedObject(
...@@ -122,8 +112,8 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedObject( ...@@ -122,8 +112,8 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedObject(
); );
/* Encodes a string object and returns the result as Python string /* Encodes a string object and returns the result as Python string
object. object.
If the codec returns an Unicode object, the object is converted If the codec returns an Unicode object, the object is converted
back to a string using the default encoding. back to a string using the default encoding.
...@@ -135,7 +125,7 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedString( ...@@ -135,7 +125,7 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedString(
const char *errors /* error handling */ const char *errors /* error handling */
); );
/* Decodes a string object and returns the result as Python /* Decodes a string object and returns the result as Python
object. */ object. */
PyAPI_FUNC(PyObject*) PyString_AsDecodedObject( PyAPI_FUNC(PyObject*) PyString_AsDecodedObject(
...@@ -145,8 +135,8 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedObject( ...@@ -145,8 +135,8 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedObject(
); );
/* Decodes a string object and returns the result as Python string /* Decodes a string object and returns the result as Python string
object. object.
If the codec returns an Unicode object, the object is converted If the codec returns an Unicode object, the object is converted
back to a string using the default encoding. back to a string using the default encoding.
...@@ -171,7 +161,7 @@ PyAPI_FUNC(int) PyString_AsStringAndSize( ...@@ -171,7 +161,7 @@ PyAPI_FUNC(int) PyString_AsStringAndSize(
(only possible for 0-terminated (only possible for 0-terminated
strings) */ strings) */
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment