diff options
author | Guido van Rossum <guido@python.org> | 2002-05-24 19:01:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-05-24 19:01:59 (GMT) |
commit | cacfc07d083286e80b6f86939d466e186f7ea3c0 (patch) | |
tree | 87e5221791901acdca69ef823d93d470679fa49c /Python | |
parent | 9ee4b94f51d19a37db3b93222b5e15c8379db78d (diff) | |
download | cpython-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 'Python')
-rw-r--r-- | Python/bltinmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d0411e2..311176e 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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); |