diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-08-25 23:13:17 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-08-25 23:13:17 (GMT) |
commit | 0e10206f2cc7b3fac5ad30cd45583c8f1a8a6126 (patch) | |
tree | 51769797eedbf38cd6b09a5aaaa730ad751d57bb | |
parent | dc078de4931b309e39498c3fd5e521cf084a5d45 (diff) | |
download | cpython-0e10206f2cc7b3fac5ad30cd45583c8f1a8a6126.zip cpython-0e10206f2cc7b3fac5ad30cd45583c8f1a8a6126.tar.gz cpython-0e10206f2cc7b3fac5ad30cd45583c8f1a8a6126.tar.bz2 |
basicsize and itemsize are Py_ssize_t #9688
-rw-r--r-- | Lib/test/test_types.py | 5 | ||||
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index d82c846..d16dbba 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -550,6 +550,11 @@ class TypesTests(unittest.TestCase): for code in 'xXobns': self.assertRaises(ValueError, format, 0, ',' + code) + def test_internal_sizes(self): + self.assertGreater(object.__basicsize__, 0) + self.assertGreater(tuple.__itemsize__, 0) + + def test_main(): run_unittest(TypesTests) @@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2? Core and Builtins ----------------- +- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t. + - Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match the pyconfig.h generated by configure on other systems. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 1babcb6..8b74e1e 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -189,8 +189,8 @@ assign_version_tag(PyTypeObject *type) static PyMemberDef type_members[] = { - {"__basicsize__", T_INT, offsetof(PyTypeObject,tp_basicsize),READONLY}, - {"__itemsize__", T_INT, offsetof(PyTypeObject, tp_itemsize), READONLY}, + {"__basicsize__", T_PYSSIZET, offsetof(PyTypeObject,tp_basicsize),READONLY}, + {"__itemsize__", T_PYSSIZET, offsetof(PyTypeObject, tp_itemsize), READONLY}, {"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY}, {"__weakrefoffset__", T_LONG, offsetof(PyTypeObject, tp_weaklistoffset), READONLY}, |