summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-05-24 19:01:59 (GMT)
committerGuido van Rossum <guido@python.org>2002-05-24 19:01:59 (GMT)
commitcacfc07d083286e80b6f86939d466e186f7ea3c0 (patch)
tree87e5221791901acdca69ef823d93d470679fa49c /Objects/object.c
parent9ee4b94f51d19a37db3b93222b5e15c8379db78d (diff)
downloadcpython-cacfc07d083286e80b6f86939d466e186f7ea3c0.zip
cpython-cacfc07d083286e80b6f86939d466e186f7ea3c0.tar.gz
cpython-cacfc07d083286e80b6f86939d466e186f7ea3c0.tar.bz2
- 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.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 1bd8db9..b1bf2c3 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1779,6 +1779,9 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyBool_Type) < 0)
Py_FatalError("Can't initialize 'bool'");
+ if (PyType_Ready(&PyString_Type) < 0)
+ Py_FatalError("Can't initialize 'str'");
+
if (PyType_Ready(&PyList_Type) < 0)
Py_FatalError("Can't initialize 'list'");