- 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:
Guido van Rossum 2002-05-24 19:01:59 +00:00
parent 9ee4b94f51
commit cacfc07d08
6 changed files with 69 additions and 2 deletions

View file

@ -39,6 +39,7 @@ typedef struct {
char ob_sval[1];
} PyStringObject;
extern DL_IMPORT(PyTypeObject) PyBaseString_Type;
extern DL_IMPORT(PyTypeObject) PyString_Type;
#define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type)