mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
When __slots__ are set to a unicode string, make it work the same as
setting a plain string, ie don't expand to single letter identifiers.
This commit is contained in:
parent
e6bdb9be0e
commit
cbd9ee69ee
3 changed files with 21 additions and 2 deletions
|
@ -1816,7 +1816,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
|
|||
/* Have slots */
|
||||
|
||||
/* Make it into a tuple */
|
||||
if (PyString_Check(slots))
|
||||
if (PyString_Check(slots) || PyUnicode_Check(slots))
|
||||
slots = PyTuple_Pack(1, slots);
|
||||
else
|
||||
slots = PySequence_Tuple(slots);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue