Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0e10206f
Commit
0e10206f
authored
Aug 25, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basicsize and itemsize are Py_ssize_t #9688
parent
dc078de4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
Lib/test/test_types.py
Lib/test/test_types.py
+5
-0
Misc/NEWS
Misc/NEWS
+2
-0
Objects/typeobject.c
Objects/typeobject.c
+2
-2
No files found.
Lib/test/test_types.py
View file @
0e10206f
...
@@ -550,6 +550,11 @@ class TypesTests(unittest.TestCase):
...
@@ -550,6 +550,11 @@ class TypesTests(unittest.TestCase):
for
code
in
'xXobns'
:
for
code
in
'xXobns'
:
self
.
assertRaises
(
ValueError
,
format
,
0
,
','
+
code
)
self
.
assertRaises
(
ValueError
,
format
,
0
,
','
+
code
)
def
test_internal_sizes
(
self
):
self
.
assertGreater
(
object
.
__basicsize__
,
0
)
self
.
assertGreater
(
tuple
.
__itemsize__
,
0
)
def
test_main
():
def
test_main
():
run_unittest
(
TypesTests
)
run_unittest
(
TypesTests
)
...
...
Misc/NEWS
View file @
0e10206f
...
@@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2?
...
@@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2?
Core and Builtins
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,
- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h,
to match the pyconfig.h generated by configure on other systems.
to match the pyconfig.h generated by configure on other systems.
...
...
Objects/typeobject.c
View file @
0e10206f
...
@@ -189,8 +189,8 @@ assign_version_tag(PyTypeObject *type)
...
@@ -189,8 +189,8 @@ assign_version_tag(PyTypeObject *type)
static
PyMemberDef
type_members
[]
=
{
static
PyMemberDef
type_members
[]
=
{
{
"__basicsize__"
,
T_
IN
T
,
offsetof
(
PyTypeObject
,
tp_basicsize
),
READONLY
},
{
"__basicsize__"
,
T_
PYSSIZE
T
,
offsetof
(
PyTypeObject
,
tp_basicsize
),
READONLY
},
{
"__itemsize__"
,
T_
IN
T
,
offsetof
(
PyTypeObject
,
tp_itemsize
),
READONLY
},
{
"__itemsize__"
,
T_
PYSSIZE
T
,
offsetof
(
PyTypeObject
,
tp_itemsize
),
READONLY
},
{
"__flags__"
,
T_LONG
,
offsetof
(
PyTypeObject
,
tp_flags
),
READONLY
},
{
"__flags__"
,
T_LONG
,
offsetof
(
PyTypeObject
,
tp_flags
),
READONLY
},
{
"__weakrefoffset__"
,
T_LONG
,
{
"__weakrefoffset__"
,
T_LONG
,
offsetof
(
PyTypeObject
,
tp_weaklistoffset
),
READONLY
},
offsetof
(
PyTypeObject
,
tp_weaklistoffset
),
READONLY
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment