diff Python/bltinmodule.c @ 23542:220b98f06415 legacy-trunk

- 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.
author Guido van Rossum <guido@python.org>
date Fri, 24 May 2002 19:01:59 +0000
parents 642a453e7a2e
children ed007e47b3a1
line wrap: on
line diff
--- a/Python/bltinmodule.c	Fri May 24 18:47:47 2002 +0000
+++ b/Python/bltinmodule.c	Fri May 24 19:01:59 2002 +0000
@@ -1905,6 +1905,7 @@
 	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);