Yury Selivanov
056e265491
Issue #20786 : Fix signatures for dict.__delitem__ and property.__delete__
12 years ago
Antoine Pitrou
f0b5a7c0f6
Issue #20637 : Key-sharing now also works for instance dictionaries of subclasses. Patch by Peter Ingebretson.
12 years ago
Benjamin Peterson
e686c5c3e8
look up __getnewargs__ and __getnewargs_ex__ on the object type ( #16251 )
12 years ago
Larry Hastings
69a2547cd5
Issue #20530 : The signatures for slot builtins have been updated
to reflect the fact that they only accept positional-only arguments.
12 years ago
Larry Hastings
2623c8c23c
Issue #20530 : Argument Clinic's signature format has been revised again.
The new syntax is highly human readable while still preventing false
positives. The syntax also extends Python syntax to denote "self" and
positional-only parameters, allowing inspect.Signature objects to be
totally accurate for all supported builtins in Python 3.4.
12 years ago
Victor Stinner
1ea4e4174b
Issue #17162 : Fix compilation, replace non-breaking space with an ASCII space
12 years ago
Martin v. Löwis
ca7b04644c
Issue #17162 : Add PyType_GetSlot.
12 years ago
Larry Hastings
581ee3618c
Issue #20326 : Argument Clinic now uses a simple, unique signature to
annotate text signatures in docstrings, resulting in fewer false
positives. "self" parameters are also explicitly marked, allowing
inspect.Signature() to authoritatively detect (and skip) said parameters.
Issue #20326 : Argument Clinic now generates separate checksums for the
input and output sections of the block, allowing external tools to verify
that the input has not changed (and thus the output is not out-of-date).
12 years ago
Larry Hastings
5c66189e88
Issue #20189 : Four additional builtin types (PyTypeObject,
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
have been modified to provide introspection information for builtins.
Also: many additional Lib, test suite, and Argument Clinic fixes.
12 years ago
Christian Heimes
d3afe781b1
Silence expression result unused warnings with clang.
The PyObject_INIT() macros returns obj:
../cpython/Objects/methodobject.c:32:23: warning: expression result unused [-Wunused-value]
PyObject_INIT(op, &PyCFunction_Type);
^~
../cpython/Include/objimpl.h:139:69: note: expanded from macro 'PyObject_INIT'
( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
^
1 warning generated.
12 years ago
Alexandre Vassalotti
1a83070d9e
Issue #19088 : Fix incorrect caching of the copyreg module.
This fix does not cause any degradation in performance.
12 years ago
Christian Heimes
2489bd83f5
Issue #17810 : Fixed NULL check in _PyObject_GetItemsIter()
CID 1131948: Logically dead code (DEADCODE)
12 years ago
Antoine Pitrou
c9dc4a2a8a
Issue #17810 : Implement PEP 3154, pickle protocol 4.
Most of the work is by Alexandre.
12 years ago
Victor Stinner
3f36a5736b
Issue #19515 : Remove identifiers duplicated in the same file.
Patch written by Andrei Dorian Duma.
13 years ago
Victor Stinner
bd303c165b
Issue #19512 , #19515 : remove shared identifiers, move identifiers where they
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
13 years ago
Martin v. Löwis
e75fc14813
Issue #19514 : Deduplicate some _Py_IDENTIFIER declarations.
Patch by Andrei Dorian Duma.
13 years ago
Victor Stinner
ad14ccd047
Issue #19512 : add _PyUnicode_CompareWithId() function
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString()
when both strings are equal and interned.
Add also _PyId_builtins identifier for "builtins" common string.
13 years ago
Victor Stinner
3688aa9a04
Issue #19512 : type_abstractmethods() and type_set_abstractmethods() now use an
identifier for the "__abstractmethods__" string
13 years ago
Antoine Pitrou
84745ab464
Issue #17936 : Fix O(n**2) behaviour when adding or removing many subclasses of a given type.
13 years ago
Victor Stinner
bebba5059c
fix indent
13 years ago
Raymond Hettinger
2ff2190b62
Issue #18594 : Fix the fast path for collections.Counter().
The path wasn't being taken due to an over-restrictive type check.
13 years ago
Victor Stinner
33824f6fd7
Restore changeset 5bd9db528aed (issue #18408 )
"Issue #18408 : PyObject_Str(), PyObject_Repr() and type_call() now fail with an
assertion error if they are called with an exception set (PyErr_Occurred()).
As PyEval_EvalFrameEx(), they may clear the current exception and so the caller
looses its exception."
13 years ago
Antoine Pitrou
91541931f5
Back out 5bd9db528aed (issue #18408 ). It caused unsolved buildbot failures.
13 years ago
Antoine Pitrou
796564c27b
Issue #18112 : PEP 442 implementation (safe object finalization).
13 years ago
Christian Heimes
de4d183955
Issue #18327 : Fix argument order in call to compatible_for_assignment(oldto, newto, attr).
The fix only affects the error message of __class__ assignment. CID 983564
13 years ago
Victor Stinner
8e47832737
Issue #18408 : PyObject_Str(), PyObject_Repr() and type_call() now fail with an
assertion error if they are called with an exception set (PyErr_Occurred()).
As PyEval_EvalFrameEx(), they may clear the current exception and so the caller
looses its exception.
13 years ago
Victor Stinner
5967bf4928
Issue #18408 : Fix PyType_Ready(), handle _PyDict_SetItemId() failure
13 years ago
Victor Stinner
3997cfdb7f
Cleanup type_call() to ease debug
It was easy to miss the call to type->tp_init because it was done in a long
conditional expression. Split the long expression in multiple lines to make the
debug step by step easier.
13 years ago
Victor Stinner
53510cda59
Issue #18408 : type_new() and PyType_FromSpecWithBases() now raise MemoryError
on memory allocation failure
13 years ago
Victor Stinner
a41f085144
Issue #18408 : pmerge() help of mro_implementation() now raises MemoryError on
memory allocation failure
Replace also PyMem_Free() with PyMem_FREE() to be consistent with the rest of
the function.
13 years ago
Victor Stinner
2e8474ddde
Issue #18408 : slot_tp_str() must not fallback on slot_tp_repr() on error
type->tp_str must not point to slot_tp_str() if type has no __str__ attribute,
so there is no reason for slot_tp_str() to fallback on slot_tp_str() on lookup
error. Moreover, calling PyErr_Clear() may hide a real bug like MemoryError.
If __str__ attribute is removed, slots must be updated (which is done by
type_setattro()).
13 years ago
Victor Stinner
54e4ca76c9
typeobject.c: remove trailing spaces
13 years ago
Victor Stinner
9812af8e72
Issue #18408 : Fix PyType_Ready() and type.__bases__ setter to handle
PyWeakref_NewRef() failure (ex: MemoryError).
13 years ago
Benjamin Peterson
e1b4cbc422
when arguments are cells clear the locals slot (backport of #17927 )
13 years ago
Benjamin Peterson
159ae41da6
when an argument is a cell, set the local copy to NULL (see #17927 )
13 years ago
Guido van Rossum
6832c81d5d
#17927 : Keep frame from referencing cell-ified arguments.
13 years ago
Antoine Pitrou
957a23b088
Issue #17408 : Avoid using an obsolete instance of the copyreg module when the interpreter is shutdown and then started again.
13 years ago
Mark Dickinson
64aafeb4de
Issue #16447 : Fix potential segfault when setting __name__ on a class.
13 years ago
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
Andrew Svetlov
3ba3a3ee56
Issue #15422 : get rid of PyCFunction_New macro
13 years ago
Andrew Svetlov
2cd8ce4690
Issue #9856 : Replace deprecation warinigs to raising TypeError in object.__format__
Patch by Florent Xicluna.
13 years ago
Benjamin Peterson
2c05a2e01b
do safety checks on __qualname__ assignment
14 years ago
Benjamin Peterson
8afa7fa510
don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ ( closes #16271 )
14 years ago
Victor Stinner
4ca1cf35fb
Issue #16086 : PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
... (unsigned long and unsigned int) to avoid an undefined behaviour with
Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is now
unsigned too (unsigned long, instead of long).
14 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