summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* 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
* call_method() and call_maybe() now use fast callVictor Stinner2016-08-191-20/+26
| | | | | | 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.
* Cleanup call_method() and call_maybe()Victor Stinner2016-08-191-14/+12
| | | | Issue #27128. Move va_start/va_end around Py_VaBuildValue().
* Merge 3.5 (fix refleak in call_maybe())Victor Stinner2016-08-191-1/+3
|\
| * Fix a refleak in call_maybe()Victor Stinner2016-08-191-1/+3
| | | | | | | | | | Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails.
* | Merge 3.5 (fix refleak in call_method)Victor Stinner2016-08-191-1/+3
|\ \ | |/
| * Fix a refleak in call_method()Victor Stinner2016-08-191-1/+3
| | | | | | | | | | Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails.
* | contains and rich compare slots use fast callVictor Stinner2016-08-191-16/+4
| | | | | | | | | | 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.
* | Fix PyObject_Call() parameter namesVictor Stinner2016-08-191-2/+4
| | | | | | | | | | | | Issue #27128: arg=>args, kw=>kwargs. Same change for PyEval_CallObjectWithKeywords().
* | Avoid call_function_tail() for empty format strVictor Stinner2016-08-191-20/+19
| | | | | | | | | | | | Issue #27128, PyObject_CallFunction(), _PyObject_FastCall() and callmethod(): if the format string of parameters is empty, avoid the creation of an empty tuple: call _PyObject_FastCall() without parameters.
* | PEP 7: add {...} around null_error() in abstract.cVictor Stinner2016-08-191-28/+65
| | | | | | | | Issue #27128.
* | Cleanup callmethod()Victor Stinner2016-08-191-2/+6
| | | | | | | | | | | | | | Make callmethod() less weird: don't decrement func reference counter, the caller is now responsible to do that. Issue #27128.
* | Cleanup call_function_tail()Victor Stinner2016-08-191-20/+29
| | | | | | | | | | | | | | | | Make call_function_tail() less weird: don't decrement args reference counter, the caller is now responsible to do that. The caller now also checks if args is NULL. Issue #27128.
* | call_function_tail() uses fast callVictor Stinner2016-08-191-13/+6
| | | | | | | | | | | | | | | | | | | | | | Issue #27128: Modify call_function_tail() to use _PyObject_FastCall() when args is not a tuple to avoid the creation of a temporary tuple. call_function_tail() is used by: * PyObject_CallFunction() * PyObject_CallMethod() * _PyObject_CallMethodId()
* | Add _PyObject_FastCall()Victor Stinner2016-08-192-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27128: Add _PyObject_FastCall(), a new calling convention avoiding a temporary tuple to pass positional parameters in most cases, but create a temporary tuple if needed (ex: for the tp_call slot). The API is prepared to support keyword parameters, but the full implementation will come later (_PyFunction_FastCall() doesn't support keyword parameters yet). Add also: * _PyStack_AsTuple() helper function: convert a "stack" of parameters to a tuple. * _PyCFunction_FastCall(): fast call implementation for C functions * _PyFunction_FastCall(): fast call implementation for Python functions
* | Issue #12946: Remove dead code in PyModule_GetDictBerker Peksag2016-08-191-2/+1
| | | | | | | | | | | | PyModule_NewObject already sets md_dict to PyDict_New(): m->md_dict = PyDict_New();
* | Issue #27157: Make only type() itself accept the one-argument formBerker Peksag2016-08-191-4/+6
| | | | | | | | Patch by Eryk Sun and Emanuel Barry.
* | Anti-registration of various ABC methods.Guido van Rossum2016-08-182-2/+24
| | | | | | | | | | | | | | | | | | | | - 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.
* | Issue #27786: Simplify x_sub()Victor Stinner2016-08-171-3/+1
| | | | | | | | | | The z variable is known to be a fresh number which cannot be shared, Py_SIZE() can be used directly to negate the number.
* | Issue #27704: Optimized creating bytes and bytearray from byte-like objectsSerhiy Storchaka2016-08-152-20/+16
| | | | | | | | | | and iterables. Speed up to 3 times for short objects. Original patch by Naoki Inada.
* | Issue #27574: Decreased an overhead of parsing keyword arguments in functionsSerhiy Storchaka2016-08-142-18/+26
| | | | | | | | implemented with using Argument Clinic.
* | Issue #26754: Undocumented support of general bytes-like objectsSerhiy Storchaka2016-08-061-6/+7
| | | | | | | | as path in compile() and similar functions is now deprecated.
* | Merge spelling and grammar fixes from 3.5Martin Panter2016-08-052-2/+2
|\ \ | |/
| * Fix spelling and grammar in documentation and code commentsMartin Panter2016-08-042-2/+2
| |
* | Issue #27652: Expose ESHUTDOWN conditionallyBerker Peksag2016-07-301-0/+2
| | | | | | | | | | | | ESHUTDOWN is also exposed conditionally in Modules/errnomodule.c. Patch by Ed Schouten.
* | Issue #27366: Tweak PEP 487 documentationBerker Peksag2016-07-301-4/+3
| | | | | | | | | | | | * Added versionadded directives * Deleted duplicate sentence from __init_subclass__ docstring * Modernized tests
* | Issue #27366: Implement PEP 487Nick Coghlan2016-07-301-7/+92
| | | | | | | | | | | | - __init_subclass__ called when new subclasses defined - __set_name__ called when descriptors are part of a class definition
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-282-5/+5
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-282-5/+5
| | | | | | | | Based on patch by Ville Skyttä.
* | (merge from 3.5) Issue #26662: Set PYTHON_FOR_GEN in configureXavier de Gaye2016-07-261-26/+37
|\ \ | |/ | | | | as the Python program to be used for file generation during the build.
| * Issue #26662: Set PYTHON_FOR_GEN in configureXavier de Gaye2016-07-261-26/+37
| | | | | | | | as the Python program to be used for file generation during the build.
* | Issue #1621: Avoid signed overflow in list and tuple operationsMartin Panter2016-07-252-10/+12
| | | | | | | | Patch by Xiang Zhang.
* | Issue #27581: Merge overflow fix from 3.5Martin Panter2016-07-251-4/+5
|\ \ | |/
| * Issue #27581: Don’t rely on overflow wrapping in PySequence_Tuple()Martin Panter2016-07-251-4/+5
| | | | | | | | Patch by Xiang Zhang.
* | Issue #27454: Use PyDict_SetDefault in PyUnicode_InternInPlaceBerker Peksag2016-07-251-14/+6
| | | | | | | | Patch by INADA Naoki.
* | Issue #27507: Merge overflow check from 3.5Martin Panter2016-07-181-1/+11
|\ \ | |/
| * Issue #27507: Check for integer overflow in bytearray.extend()Martin Panter2016-07-181-1/+11
| | | | | | | | Patch by Xiang Zhang.
* | Backed out changeset af29d89083b3 (closes #25548) (closes #27498)Benjamin Peterson2016-07-141-3/+3
| |
* | Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka2016-07-102-16/+11
|\ \ | |/ | | | | concatenations. Patch by Xiang Zhang.
| * Issue #27473: Fixed possible integer overflow in bytes and bytearraySerhiy Storchaka2016-07-102-16/+11
| | | | | | | | concatenations. Patch by Xiang Zhang.
* | Merge: #20647: Update dictobject.c comments to account for randomized string ↵R David Murray2016-07-101-8/+5
|\ \ | |/ | | | | hashes.
| * #20647: Update dictobject.c comments to account for randomized string hashes.R David Murray2016-07-101-8/+5
| | | | | | | | Patch by Jaysinh Shukla.
* | Issue #27474: Unified error messages in the __contains__ method of bytes andSerhiy Storchaka2016-07-101-1/+1
| | | | | | | | | | bytearray for integers in and out of the Py_ssize_t range. Patch by Xiang Zhang.