summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | replace PY_LONG_LONG with long longBenjamin Peterson2016-09-064-60/+60
| | | |
* | | | Avoid calling functions with an empty string as format stringVictor Stinner2016-09-062-2/+2
| | | | | | | | | | | | | | | | Directly pass NULL rather than an empty string.
* | | | Avoid inefficient way to call functions without argumentVictor Stinner2016-09-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | require a long long data type (closes #27961)Benjamin Peterson2016-09-063-38/+0
| | | |
* | | | Issue #27938: Add a fast-path for us-ascii encodingVictor Stinner2016-09-051-56/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other changes: * Rewrite _Py_normalize_encoding() as a C implementation of encodings.normalize_encoding(). For example, " utf-8 " is now normalized to "utf_8". So the fast path is now used for more name variants of the same encoding. * Avoid strcpy() when encoding is NULL: call directly the UTF-8 codec
* | | | Issue #24254: Preserve class attribute definition order.Eric Snow2016-09-052-1/+80
| | | |
* | | | remove memory indirections in dict_traverse (closes #27956)Benjamin Peterson2016-09-051-9/+11
| | | |
* | | | Issue #27830: Remove unused _PyStack_AsDict()Victor Stinner2016-09-051-34/+0
| | | | | | | | | | | | | | | | I forgot to remove this function, I made a mistake in my revert.
* | | | merge 3.5 (#27812)Benjamin Peterson2016-09-051-1/+4
|\ \ \ \ | |/ / /
| * | | clear out f_gen during generator finalization (closes #27812)Benjamin Peterson2016-09-051-1/+4
| | | | | | | | | | | | | | | | Patch from Armin Rigo.
* | | | merge 3.5 (closes #27811)Benjamin Peterson2016-09-051-12/+13
|\ \ \ \ | |/ / /
| * | | do not allow _PyGen_Finalize to fail (closes #27811)Benjamin Peterson2016-09-051-12/+13
| | | | | | | | | | | | | | | | Patch from Armin Rigo.
* | | | Issue #11734: Add support for IEEE 754 half-precision floats to the struct ↵Mark Dickinson2016-09-031-1/+183
| | | | | | | | | | | | | | | | module. Original patch by Eli Stevens.
* | | | PEP 7 style for if/else in CVictor Stinner2016-09-022-17/+34
| | | | | | | | | | | | | | | | Add also a newline for readability in normalize_encoding().
* | | | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-308-17/+17
| | | |
* | | | Issue #27870: A left shift of zero by a large integer no longer attempts to ↵Mark Dickinson2016-08-291-0/+5
| | | | | | | | | | | | | | | | allocate large amounts of memory.
* | | | Issue #25402: in int-to-decimal-string conversion, reduce intermediate ↵Mark Dickinson2016-08-291-8/+11
| | | | | | | | | | | | | | | | storage requirements and relax restriction on converting large integers. Patch by Serhiy Storchaka.
* | | | Issue #27214: Fix potential bug and remove useless optimization in ↵Mark Dickinson2016-08-291-2/+4
| | | | | | | | | | | | | | | | long_invert. Thanks Oren Milman.
* | | | Issue #27506: Support bytes/bytearray.translate() delete as keyword argumentMartin Panter2016-08-274-60/+37
| | | | | | | | | | | | | | | | Patch by Xiang Zhang.
* | | | MergeRaymond Hettinger2016-08-261-1/+1
|\ \ \ \ | |/ / /
| * | | Issue 19504: Change "customise" to "customize" American spelling.Raymond Hettinger2016-08-261-1/+1
| | | |
* | | | Issue #27830: Revert, remove _PyFunction_FastCallKeywords()Victor Stinner2016-08-251-45/+0
| | | |
* | | | method_call() and slot_tp_new() now uses fast callVictor Stinner2016-08-243-40/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* | | | Issue #27830: Fix _PyObject_FastCallKeywords()Victor Stinner2016-08-241-1/+1
| | | | | | | | | | | | | | | | Pass stack, not unrelated and uninitialized args!
* | | | _PyObject_FastCallDict(): avoid _Py_CheckFunctionResult()Victor Stinner2016-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | _PyObject_FastCallDict() only requires _Py_CheckFunctionResult() for the slow-path. Other cases already check for the result.
* | | | Add _PyObject_FastCallKeywords()Victor Stinner2016-08-241-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | Issue #27830: Similar to _PyObject_FastCallDict(), but keyword arguments are also passed in the same C array than positional arguments, rather than being passed as a Python dict.
* | | | Use Py_ssize_t type for number of argumentsVictor Stinner2016-08-242-3/+8
| | | | | | | | | | | | | | | | | | | | Issue #27848: use Py_ssize_t rather than C int for the number of function positional and keyword arguments.
* | | | PyObject_CallMethodObjArgs() now uses fast callVictor Stinner2016-08-231-32/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27809: * PyObject_CallMethodObjArgs(), _PyObject_CallMethodIdObjArgs() and PyObject_CallFunctionObjArgs() now use fast call to avoid the creation of a temporary tuple * Rename objargs_mktuple() to objargs_mkstack() * objargs_mkstack() now stores objects in a C array using borrowed references, instead of storing arguments into a tuple objargs_mkstack() uses a small buffer allocated on the C stack for 5 arguments or less, or allocates a buffer in the heap memory. Note: this change is different than the change 0e4f26083bbb, I fixed the test to decide if the small stack can be used or not. sizeof(PyObject**) was also replaced with sizeof(stack[0]) since the sizeof() was wrong (but gave the same result).
* | | | Backed out changeset 0e4f26083bbb (PyObject_CallMethodObjArgs)Victor Stinner2016-08-231-71/+32
| | | |
* | | | PyObject_CallMethodObjArgs() now uses fast callVictor Stinner2016-08-231-32/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27809: * PyObject_CallMethodObjArgs(), _PyObject_CallMethodIdObjArgs() and PyObject_CallFunctionObjArgs() now use fast call to avoid the creation of a temporary tuple * Rename objargs_mktuple() to objargs_mkstack() * objargs_mkstack() now stores objects in a C array using borrowed references, instead of storing arguments into a tuple objargs_mkstack() uses a small buffer allocated on the C stack for 5 arguments or less, or allocates a buffer in the heap memory.
* | | | Issue #27809: Use _PyObject_FastCallDict()Victor Stinner2016-08-221-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify: * init_subclass() * builtin___build_class__() Fix also a bug in init_subclass(): check for super() failure.
* | | | Issue #27809: Use _PyObject_FastCallDict()Victor Stinner2016-08-221-24/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify: * builtin_sorted() * classmethoddescr_call() * methoddescr_call() * wrapperdescr_call()
* | | | _PyFunction_FastCallDict() supports keyword argsVictor Stinner2016-08-222-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27809: * Rename _PyFunction_FastCall() to _PyFunction_FastCallDict() * Rename _PyCFunction_FastCall() to _PyCFunction_FastCallDict() * _PyFunction_FastCallDict() now supports keyword arguments
* | | | Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-224-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* | | | Issue #27792: force int return type for modulo operations involving bools.Mark Dickinson2016-08-221-2/+5
| | | |
* | | | Issue #26984: int() now always returns an instance of exact int.Serhiy Storchaka2016-08-211-12/+23
| | | |
* | | | Untabify Objects/longobject.c.Mark Dickinson2016-08-211-2/+2
| | | |
* | | | Issue #25604: Fix minor bug in integer true division, which couldMark Dickinson2016-08-211-2/+2
| | | | | | | | | | | | | | | | have caused off-by-one-ulp results on certain platforms.
* | | | Issue #27662: don't use PY_SIZE_MAX for overflow checking in List_New. Patch ↵Mark Dickinson2016-08-211-11/+1
| | | | | | | | | | | | | | | | by Xiang Zhang.
* | | | Merge #27782 fix from 3.5Nick Coghlan2016-08-211-29/+35
|\ \ \ \ | |/ / /
| * | | Issue #27782: Fix m_methods handling in multiphase initNick Coghlan2016-08-211-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multi-phase extension module import now correctly allows the ``m_methods`` field to be used to add module level functions to instances of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
* | | | Issue #27692: Removed unnecessary NULL checks in exceptions.c.Serhiy Storchaka2016-08-201-4/+3
| | | | | | | | | | | | | | | | Patch by Xiang Zhang.
* | | | Issue #27366: Fix init_subclass()Victor Stinner2016-08-201-0/+5
| | | | | | | | | | | | | | | | Handle PyTuple_New(0) failure.
* | | | PyFile_WriteObject() now uses fast callVictor Stinner2016-08-191-9/+2
| | | | | | | | | | | | | | | | | | | | Issue #27128: PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the creation of a temporary tuple.
* | | | calliter_iternext() now uses fast callVictor Stinner2016-08-191-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27128: calliter_iternext() now calls _PyObject_FastCall() to avoid a temporary empty tuple. Cleanup also the code to reduce the indentation level.
* | | | slot_tp_iter() now uses fast callVictor Stinner2016-08-191-6/+3
| | | | | | | | | | | | | | | | | | | | Issue #27128: slot_tp_iter() now calls _PyObject_FastCall() to avoid a temporary empty tuple.
* | | | slot_nb_bool() now uses fast callVictor Stinner2016-08-191-8/+2
| | | | | | | | | | | | | | | | | | | | Issue #27128: slot_nb_bool() now calls _PyObject_FastCall() to avoid a temporary empty tuple to call the slot function.
* | | | Issue #27128: Cleanup slot_nb_bool()Victor Stinner2016-08-191-25/+41
| | | | | | | | | | | | | | | | Use an error label to reduce the level of indentation.
* | | | Issue #27128: slot_sq_item() uses fast callVictor Stinner2016-08-191-10/+3
| | | | | | | | | | | | | | | | | | | | 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.
* | | | Issue #27128: Cleanup slot_sq_item()Victor Stinner2016-08-191-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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