summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-11 03:07:38 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-11 03:07:38 (GMT)
commit78e0fc74bce026ddf67d029030a90c9b8faffcb5 (patch)
treed66ea7c58d2630b08bf81f04e3d636a15b75314a /Include/unicodeobject.h
parent0ebeb584a496fec7a09bd62cb20ceb15cabde4e7 (diff)
downloadcpython-78e0fc74bce026ddf67d029030a90c9b8faffcb5.zip
cpython-78e0fc74bce026ddf67d029030a90c9b8faffcb5.tar.gz
cpython-78e0fc74bce026ddf67d029030a90c9b8faffcb5.tar.bz2
Possibly the end of SF [#460020] bug or feature: unicode() and subclasses.
Changed unicode(i) to return a true Unicode object when i is an instance of a unicode subclass. Added PyUnicode_CheckExact macro.
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index dbeb883..d9cda95 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -61,6 +61,7 @@ Copyright (c) Corporation for National Research Initiatives.
#ifndef Py_USING_UNICODE
#define PyUnicode_Check(op) 0
+#define PyUnicode_CheckExact(op) 0
#else
@@ -373,6 +374,7 @@ typedef struct {
extern DL_IMPORT(PyTypeObject) PyUnicode_Type;
#define PyUnicode_Check(op) PyObject_TypeCheck(op, &PyUnicode_Type)
+#define PyUnicode_CheckExact(op) ((op)->ob_type == &PyUnicode_Type)
/* Fast access macros */
#define PyUnicode_GET_SIZE(op) \