mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
More on SF bug [#460020] bug or feature: unicode() and subclasses.
Repaired str(i) to return a genuine string when i is an instance of a str subclass. New PyString_CheckExact() macro.
This commit is contained in:
parent
8ff70a9606
commit
5a49ade70e
4 changed files with 10 additions and 3 deletions
|
@ -52,6 +52,7 @@ typedef struct {
|
|||
extern DL_IMPORT(PyTypeObject) PyString_Type;
|
||||
|
||||
#define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type)
|
||||
#define PyString_CheckExact(op) ((op)->ob_type == &PyString_Type)
|
||||
|
||||
extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int);
|
||||
extern DL_IMPORT(PyObject *) PyString_FromString(const char *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue