mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
More on SF bug [#460020] bug or feature: unicode() and subclasses.
tuple(i) repaired to return a true tuple when i is an instance of a tuple subclass. Added PyTuple_CheckExact macro. PySequence_Tuple(): if a tuple-like object isn't exactly a tuple, it's not safe to return the object as-is -- make a new tuple of it instead.
This commit is contained in:
parent
caaff8d95d
commit
4c3a0a35cd
3 changed files with 7 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ typedef struct {
|
|||
extern DL_IMPORT(PyTypeObject) PyTuple_Type;
|
||||
|
||||
#define PyTuple_Check(op) PyObject_TypeCheck(op, &PyTuple_Type)
|
||||
#define PyTuple_CheckExact(op) ((op)->ob_type == &PyTuple_Type)
|
||||
|
||||
extern DL_IMPORT(PyObject *) PyTuple_New(int size);
|
||||
extern DL_IMPORT(int) PyTuple_Size(PyObject *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue