Commit eea4718e authored by Guido van Rossum's avatar Guido van Rossum

Fix from SF #681367: inherit tp_as_buffer. This only applies to C

types -- Python types already inherited this.
parent 6c7438e7
...@@ -258,6 +258,10 @@ Build ...@@ -258,6 +258,10 @@ Build
C API C API
----- -----
- A C type that inherits from a base type that defines tp_as_buffer
will now inherit the tp_as_buffer pointer if it doesn't define one.
(SF #681367)
- The PyArg_Parse functions now issue a DeprecationWarning if a float - The PyArg_Parse functions now issue a DeprecationWarning if a float
argument is provided when an integer is specified (this affects the 'b', argument is provided when an integer is specified (this affects the 'b',
'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
......
...@@ -2915,6 +2915,8 @@ PyType_Ready(PyTypeObject *type) ...@@ -2915,6 +2915,8 @@ PyType_Ready(PyTypeObject *type)
type->tp_as_sequence = base->tp_as_sequence; type->tp_as_sequence = base->tp_as_sequence;
if (type->tp_as_mapping == NULL) if (type->tp_as_mapping == NULL)
type->tp_as_mapping = base->tp_as_mapping; type->tp_as_mapping = base->tp_as_mapping;
if (type->tp_as_buffer == NULL)
type->tp_as_buffer = base->tp_as_buffer;
} }
/* Link into each base class's list of subclasses */ /* Link into each base class's list of subclasses */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment