mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
- A new type object, 'string', is added. This is a common base type
for 'str' and 'unicode', and can be used instead of types.StringTypes, e.g. to test whether something is "a string": isinstance(x, string) is True for Unicode and 8-bit strings. This is an abstract base class and cannot be instantiated directly.
This commit is contained in:
parent
9ee4b94f51
commit
cacfc07d08
6 changed files with 69 additions and 2 deletions
|
@ -1905,6 +1905,7 @@ _PyBuiltin_Init(void)
|
|||
SETBUILTIN("object", &PyBaseObject_Type);
|
||||
SETBUILTIN("staticmethod", &PyStaticMethod_Type);
|
||||
SETBUILTIN("str", &PyString_Type);
|
||||
SETBUILTIN("string", &PyBaseString_Type);
|
||||
SETBUILTIN("super", &PySuper_Type);
|
||||
SETBUILTIN("tuple", &PyTuple_Type);
|
||||
SETBUILTIN("type", &PyType_Type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue