Benjamin Peterson
6395241471
list slotdefs in offset order rather than sorting them ( closes #17610 )
This means we can remove our usage of qsort() than relied on undefined behavior.
13 years ago
R David Murray
5aff27aec1
#7963 : fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
13 years ago
R David Murray
6b30759022
#7963 : fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
13 years ago
Raymond Hettinger
ac7b49f407
Improve tooltips by listing the most common argument pattern first.
13 years ago
Benjamin Peterson
2c05a2e01b
do safety checks on __qualname__ assignment
13 years ago
Benjamin Peterson
8afa7fa510
don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ ( closes #16271 )
13 years ago
Trent Nelson
ab02db23b1
Silence compiler warnings on Solaris 10 via explicit (void *) casts.
(Compiler: Solaris Studio 12.3)
14 years ago
Christian Heimes
e81dc296f2
Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_name returns NULL. CID 715371
14 years ago
Christian Heimes
47770ed914
Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_name returns NULL. CID 715371
14 years ago
Christian Heimes
a0e7e41cba
Fixed possible reference leak to mod when type_name() returns NULL
14 years ago
Christian Heimes
4e80eea60e
Fixed possible reference leak to mod when type_name() returns NULL
14 years ago
Antoine Pitrou
58098a77e6
Issue #13992 : The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.
Because of this change, a couple extension modules compiled for 2.7.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 2.7.3 and earlier. However, extension modules
compiled for 2.7.3 and earlier will be loadable by 2.7.4.
14 years ago
Antoine Pitrou
56cd62c04a
Issue #13992 : The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.
Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
14 years ago
Antoine Pitrou
2b0218a259
Issue #13992 : The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.
Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
14 years ago
Benjamin Peterson
6a42bd67d7
Make super() internal errors RuntimeError instead of SystemError ( closes #15839 )
14 years ago
Antoine Pitrou
6f430e4963
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Antoine Pitrou
c5bef75c77
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Antoine Pitrou
66a3a7ed10
Try to fix crash on x86 OpenIndiana buildbot.
14 years ago
Antoine Pitrou
1351ca6e66
Replace assert() with a more informative fatal error.
14 years ago
Antoine Pitrou
bb78f57c14
Use struct member (ht_type) instead of casting pointers.
14 years ago
Martin v. Löwis
9c56409d33
Issue #15146 : Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
14 years ago
Antoine Pitrou
99cc629969
Issue #15142 : Fix reference leak when deallocating instances of types created using PyType_FromSpec().
14 years ago
Nick Coghlan
0b43bcf528
Close #14857 : fix regression in references to PEP 3135 implicit __class__ closure variable. Reopens issue #12370 , but also updates unittest.mock to workaround that issue
14 years ago
Antoine Pitrou
a1433fed8e
Remove tab characters
14 years ago
Antoine Pitrou
682d94c11a
Use size_t, not ssize_t (issue #14801 ).
14 years ago
Benjamin Peterson
f1ae5cf5c7
fix possible refleak ( closes #14752 )
14 years ago
Benjamin Peterson
89a6e9a27b
fix possible refleak ( closes #14752 )
14 years ago
Benjamin Peterson
64acccf46d
decref cached keys on type deallocation ( #13903 )
14 years ago
Martin v. Loewis
4f2f3b6217
Account for shared keys in type's __sizeof__ ( #13903 ).
14 years ago
Benjamin Peterson
7b1668735a
don't use a slot wrapper from a different special method ( closes #14658 )
This also alters the fix to #11603 . Specifically, setting __repr__ to
object.__str__ now raises a recursion RuntimeError when str() or repr() is
called instead of silently bypassing the recursion. I believe this behavior is
more correct.
14 years ago
Benjamin Peterson
d157a4c3dd
don't use a slot wrapper from a different special method ( closes #14658 )
This also alters the fix to #11603 . Specifically, setting __repr__ to
object.__str__ now raises a recursion RuntimeError when str() or repr() is
called instead of silently bypassing the recursion. I believe this behavior is
more correct.
14 years ago
Benjamin Peterson
7d95e40721
Implement PEP 412: Key-sharing dictionaries ( closes #13903 )
Patch from Mark Shannon.
14 years ago
Benjamin Peterson
b6af60c2a9
adjust formatting
14 years ago
Benjamin Peterson
3471bb67e7
remove extraneous condition
14 years ago
Benjamin Peterson
ab3c1c1994
be consistent with rest of function
14 years ago
Victor Stinner
3c1e48176e
Issue #14383 : Add _PyDict_GetItemId() and _PyDict_SetItemId() functions
These functions simplify the usage of static constant Unicode strings.
Generalize the usage of _Py_Identifier in ceval.c and typeobject.c.
14 years ago
Benjamin Peterson
96384b93aa
make extra arguments to object.__init__/__new__ to errors in most cases (finishes #1683368 )
14 years ago
Benjamin Peterson
9a03ecfa50
simply this slightly
14 years ago
Benjamin Peterson
6e7832b04c
check to make sure the attribute is a string ( #14334 )
14 years ago
Benjamin Peterson
16d84ac355
check to make sure the attribute is a string ( #14334 )
14 years ago
Victor Stinner
d74782b0ac
Close #14199 : _PyType_Lookup() and super_getattro() keep a strong reference to
the type MRO to avoid a crash if the MRO is changed during the lookup.
14 years ago
Benjamin Peterson
52c424343d
allow cycles throught the __dict__ slot to be cleared ( closes #1469629 )
Patch from Armin, test from me.
14 years ago
Victor Stinner
6f73874edd
Close #14095 : type.__new__() doesn't remove __qualname__ key from the class
dict anymore if the key is present. Reject also non-string qualified names.
And fix reference leaks in type.__new__().
14 years ago
Benjamin Peterson
006c5a2235
check for NULL to fix segfault
14 years ago
Benjamin Peterson
8eb1269c34
add generic implementation of a __dict__ descriptor for C types
14 years ago
Benjamin Peterson
2652d2570e
ready types returned from PyType_FromSpec
14 years ago
Benjamin Peterson
e28108cbd7
adjust declaration
14 years ago
Benjamin Peterson
ce79852077
use the static identifier api for looking up special methods
I had to move the static identifier code from unicodeobject.h to object.h in
order for this to work.
14 years ago
Benjamin Peterson
a8d458560e
allow cycles throught the __dict__ slot to be cleared ( closes #1469629 )
Patch from Armin, test from me.
14 years ago
Antoine Pitrou
5b62942074
Issue #13577 : Built-in methods and functions now have a __qualname__.
Patch by sbt.
14 years ago