Serhiy Storchaka
d5d32d2127
Issue #28214 : Improved exception reporting for problematic __set_name__
attributes.
9 years ago
Christian Heimes
5cade88ac1
Check return value of _PyDict_SetItemId()
10 years ago
Serhiy Storchaka
8ef34600c7
Issue #26906 : Resolving special methods of uninitialized type now causes
implicit initialization of the type instead of a fail.
10 years ago
Serhiy Storchaka
de0574bdab
Issue #18287 : PyType_Ready() now checks that tp_name is not NULL.
Original patch by Niklas Koep.
10 years ago
Benjamin Peterson
8f657c35b9
ensure gc tracking is off when invoking weakref callbacks ( closes #26617 )
10 years ago
Serhiy Storchaka
afd02a439f
Issue #28214 : Now __set_name__ is looked up on the class instead of the
instance.
10 years ago
Nick Coghlan
944368e1cc
Issue #23722 : Initialize __class__ from type.__new__()
The __class__ cell used by zero-argument super() is now initialized
from type.__new__ rather than __build_class__, so class methods
relying on that will now work correctly when called from metaclass
methods during class creation.
Patch by Martin Teichmann.
10 years ago
Serhiy Storchaka
7c19affdce
Issue #25856 : The __module__ attribute of extension classes and functions
now is interned. This leads to more compact pickle data with protocol 4.
10 years ago
Benjamin Peterson
6cb526e54d
remove unconvincing use of Py_LOCAL
10 years ago
Eric Snow
4f29e75289
Issue #24254 : Drop cls.__definition_order__.
10 years ago
Christian Heimes
07a2a1b7e5
Additional safe-guard against dereferencing NULL in reduce_newobj
_PyObject_GetNewArguments() can leave args == NULL but the __newobj_ex__
branch expects args to be not-NULL.
CID 1353201
10 years ago
Martin Panter
0be894b2f6
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
10 years ago
Victor Stinner
ad8c83ad6b
Avoid inefficient way to call functions without argument
Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
10 years ago
Eric Snow
92a6c170e6
Issue #24254 : Preserve class attribute definition order.
10 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
10 years ago
Victor Stinner
3f1057a4b6
method_call() and slot_tp_new() now uses fast call
Issue #27841 : Add _PyObject_Call_Prepend() helper function to prepend an
argument to existing arguments to call a function. This helper uses fast calls.
Modify method_call() and slot_tp_new() to use _PyObject_Call_Prepend().
10 years ago
Victor Stinner
463b86a881
Issue #27809 : Use _PyObject_FastCallDict()
Modify:
* init_subclass()
* builtin___build_class__()
Fix also a bug in init_subclass(): check for super() failure.
10 years ago
Victor Stinner
559bb6a713
Rename _PyObject_FastCall() to _PyObject_FastCallDict()
Issue #27809 :
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
10 years ago
Victor Stinner
253021dd94
Issue #27366 : Fix init_subclass()
Handle PyTuple_New(0) failure.
10 years ago
Victor Stinner
6911267615
slot_tp_iter() now uses fast call
Issue #27128 : slot_tp_iter() now calls _PyObject_FastCall() to avoid a
temporary empty tuple.
10 years ago
Victor Stinner
20a3007a8d
slot_nb_bool() now uses fast call
Issue #27128 : slot_nb_bool() now calls _PyObject_FastCall() to avoid a
temporary empty tuple to call the slot function.
10 years ago
Victor Stinner
a12eec48b6
Issue #27128 : Cleanup slot_nb_bool()
Use an error label to reduce the level of indentation.
10 years ago
Victor Stinner
5e87749a8e
Issue #27128 : slot_sq_item() uses fast call
slot_sq_item() now calls _PyObject_FastCall() to avoid the creation of a
temporary tuple of 1 item to pass the 'item' argument to the slot function.
10 years ago
Victor Stinner
018016d8e3
Issue #27128 : Cleanup slot_sq_item()
* Invert condition of test to avoid levels of indentation
* Remove useless Py_XDECREF(args) in the error block
* Replace Py_XDECREF(func) with Py_DECREF(func) in the error block: func cannot
be NULL when reaching the error block
10 years ago
Victor Stinner
f736c261a2
call_method() and call_maybe() now use fast call
Issue #27128 . The call_method() and call_maybe() functions of typeobject.c now
use fast call for empty format string to avoid the creation of a temporary
empty tuple.
10 years ago
Victor Stinner
94463c980e
Cleanup call_method() and call_maybe()
Issue #27128 . Move va_start/va_end around Py_VaBuildValue().
10 years ago
Victor Stinner
6902ddf2ca
Fix a refleak in call_maybe()
Issue #27128 . Fix a reference leak if creating the tuple to pass positional
parameters fails.
10 years ago
Victor Stinner
d925bd5794
Fix a refleak in call_method()
Issue #27128 . Fix a reference leak if creating the tuple to pass positional
parameters fails.
10 years ago
Victor Stinner
a7720f61aa
contains and rich compare slots use fast call
Issue #27128 . Modify slot_sq_contains() and slot_tp_richcompare() to use fast
call to avoid a temporary tuple to pass a single positional parameter.
10 years ago
Berker Peksag
3f015a64b8
Issue #27157 : Make only type() itself accept the one-argument form
Patch by Eryk Sun and Emanuel Barry.
10 years ago
Guido van Rossum
97c1adf393
Anti-registration of various ABC methods.
- Issue #25958 : Support "anti-registration" of special methods from
various ABCs, like __hash__, __iter__ or __len__. All these (and
several more) can be set to None in an implementation class and the
behavior will be as if the method is not defined at all.
(Previously, this mechanism existed only for __hash__, to make
mutable classes unhashable.) Code contributed by Andrew Barnert and
Ivan Levkivskyi.
10 years ago
Martin Panter
69332c1a64
Fix spelling and grammar in documentation and code comments
10 years ago
Berker Peksag
01d1719062
Issue #27366 : Tweak PEP 487 documentation
* Added versionadded directives
* Deleted duplicate sentence from __init_subclass__ docstring
* Modernized tests
10 years ago
Nick Coghlan
d78448e912
Issue #27366 : Implement PEP 487
- __init_subclass__ called when new subclasses defined
- __set_name__ called when descriptors are part of a
class definition
10 years ago
Benjamin Peterson
ab078e9ed1
Backed out changeset af29d89083b3 ( closes #25548 ) ( closes #27498 )
10 years ago
Benjamin Peterson
27007dccec
fix refleaks in PyDict_SetItem error cases ( closes #27248 )
10 years ago
Serhiy Storchaka
484c913ed9
Issue #27225 : Fixed a reference leak in type_new when setting __new__ fails.
Patch by Xiang Zhang.
10 years ago
Kushal Das
5801ecb440
Issue #25548 : Showing memory address of class objects in repl
10 years ago
Benjamin Peterson
c352620c92
backout 3c9512d8ac0d
10 years ago
Serhiy Storchaka
27ba8864a4
Issue #27118 : Clean up Py_XINCREF/Py_XDECREF in typeobject.c.
Patch by Xiang Zhang.
10 years ago
Berker Peksag
0ac70c0e90
Fix typos. Reported by andportnoy on GitHub.
10 years ago
Martin Panter
8f26565ba9
Fix spelling (inital), grammar (may translates) in documentation, comments
10 years ago
Serhiy Storchaka
3d7497608b
Issue #26718 : super.__init__ no longer leaks memory if called multiple times.
NOTE: A direct call of super.__init__ is not endorsed!
10 years ago
Serhiy Storchaka
57a01d3a0e
Issue #26200 : Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
10 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Benjamin Peterson
9ad11544bf
set tp_new from the class in the hierarchy that actually owns the descriptor ( closes #25731 )
Debugging by Eryk Sun.
10 years ago
Barry Warsaw
09880c89e9
Comment out some tests that won't pass now that we've reverted the
picklability regression. Also, as per further discussion, remove the
regressing code.
10 years ago
Barry Warsaw
885e1939be
Issue #22995 : [UPDATE] Comment out the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects.
10 years ago
Serhiy Storchaka
576f132b98
Issue #20440 : Cleaning up the code by using Py_SETREF.
10 years ago
Serhiy Storchaka
42bf8fc901
Issue #25961 : Disallowed null characters in the type name.
Simplified testing for null characters in __name__ setter.
10 years ago