summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #15944: memoryview: Allow arbitrary formats when casting to bytes.Stefan Krah2015-08-081-8/+2
| | | | Original patch by Martin Panter.
* Issue #24667: Resize odict in all cases that the underlying dict resizes.Eric Snow2015-08-071-7/+10
|
* Issue #21279: Merge with 3.4Zachary Ware2015-08-061-5/+6
|\
| * Issue #21279: Flesh out str.translate docsZachary Ware2015-08-061-5/+6
| | | | | | | | Initial patch by Kinga Farkas, Martin Panter, and John Posner.
* | Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind()Serhiy Storchaka2015-07-202-6/+14
| | | | | | | | for single-byte argument on Linux.
* | Issue #24583: Fix crash when set is mutated while being updated.Raymond Hettinger2015-07-161-1/+2
| |
* | merge 3.4 (#24407)Benjamin Peterson2015-07-051-7/+19
|\ \ | |/
| * merge 3.3 (#24407)Benjamin Peterson2015-07-051-7/+19
| |\
| | * protect against mutation of the dict during insertion (closes #24407)Benjamin Peterson2015-07-051-7/+19
| | |
* | | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-032-7/+14
| | |
* | | Issue #24450: Add gi_yieldfrom to generators; cr_await to coroutines.Yury Selivanov2015-07-031-0/+22
| | | | | | | | | | | | Patch by Benno Leslie and Yury Selivanov.
* | | Issue #24467: Fixed possible buffer over-read in bytearray. The bytearraySerhiy Storchaka2015-06-291-1/+3
|\ \ \ | |/ / | | | | | | | | | object now always allocates place for trailing null byte and it's buffer now is always null-terminated.
| * | Issue #24467: Fixed possible buffer over-read in bytearray. The bytearraySerhiy Storchaka2015-06-291-1/+3
| | | | | | | | | | | | | | | object now always allocates place for trailing null byte and it's buffer now is always null-terminated.
* | | upgrade to Unicode 8.0.0Benjamin Peterson2015-06-271-791/+1641
| | |
* | | Issue #24439: Improve PEP 492 related docs.Yury Selivanov2015-06-241-5/+5
| | | | | | | | | | | | Patch by Martin Panter.
* | | Issue #24400: Introduce a distinct type for 'async def' coroutines.Yury Selivanov2015-06-222-57/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: 1. Coroutines now have a distinct, separate from generators type at the C level: PyGen_Type, and a new typedef PyCoroObject. PyCoroObject shares the initial segment of struct layout with PyGenObject, making it possible to reuse existing generators machinery. The new type is exposed as 'types.CoroutineType'. As a consequence of having a new type, CO_GENERATOR flag is no longer applied to coroutines. 2. Having a separate type for coroutines made it possible to add an __await__ method to the type. Although it is not used by the interpreter (see details on that below), it makes coroutines naturally (without using __instancecheck__) conform to collections.abc.Coroutine and collections.abc.Awaitable ABCs. [The __instancecheck__ is still used for generator-based coroutines, as we don't want to add __await__ for generators.] 3. Add new opcode: GET_YIELD_FROM_ITER. The opcode is needed to allow passing native coroutines to the YIELD_FROM opcode. Before this change, 'yield from o' expression was compiled to: (o) GET_ITER LOAD_CONST YIELD_FROM Now, we use GET_YIELD_FROM_ITER instead of GET_ITER. The reason for adding a new opcode is that GET_ITER is used in some contexts (such as 'for .. in' loops) where passing a coroutine object is invalid. 4. Add two new introspection functions to the inspec module: getcoroutinestate(c) and getcoroutinelocals(c). 5. inspect.iscoroutine(o) is updated to test if 'o' is a native coroutine object. Before this commit it used abc.Coroutine, and it was requested to update inspect.isgenerator(o) to use abc.Generator; it was decided, however, that inspect functions should really be tailored for checking for native types. 6. sys.set_coroutine_wrapper(w) API is updated to work with only native coroutines. Since types.coroutine decorator supports any type of callables now, it would be confusing that it does not work for all types of coroutines. 7. Exceptions logic in generators C implementation was updated to raise clearer messages for coroutines: Before: TypeError("generator raised StopIteration") After: TypeError("coroutine raised StopIteration")
* | | Fixed indentation of Python examples in C comments.Serhiy Storchaka2015-06-102-7/+7
|\ \ \ | |/ /
| * | Fixed indentation of Python examples in C comments.Serhiy Storchaka2015-06-102-7/+7
| | |
* | | repair my irrational excuberanceBenjamin Peterson2015-06-071-54/+57
| | |
* | | remove unnecessary braces and indentationBenjamin Peterson2015-06-071-58/+57
| | |
* | | fix refleak when keys() failsBenjamin Peterson2015-06-041-2/+6
| | |
* | | Issue #24369: Defend against key-changes during iteration.Eric Snow2015-06-041-13/+19
| | |
* | | Issue #24377: Fix a ref leak in OrderedDict.__repr__.Eric Snow2015-06-031-1/+1
| | |
* | | Issue #24362: Simplify the C OrderedDict fast nodes resize logic.Eric Snow2015-06-031-34/+40
| | |
* | | Issue #24368: Support keyword arguments in OrderedDict methods.Eric Snow2015-06-031-23/+49
| | |
* | | Issue #24359: Check for changed OrderedDict size during iteration.Eric Snow2015-06-021-0/+10
| | |
* | | Issue #24348: Drop superfluous increfs/decrefs.Eric Snow2015-06-021-33/+13
| | |
* | | Issue #24347: Set KeyError if PyDict_GetItemWithError returns NULL.Eric Snow2015-06-021-15/+47
| | |
* | | add Py_tp_finalize slot (closes #24345)Benjamin Peterson2015-06-011-0/+1
| | | | | | | | | | | | Patch from Petr Viktorin.
* | | Issue #24284: The startswith and endswith methods of the str class no longerSerhiy Storchaka2015-05-311-3/+3
| | | | | | | | | | | | | | | return True when finding the empty string and the indexes are completely out of range.
* | | Issue #16991: Fix a few leaks and other memory-related concerns in OrderedDict.Eric Snow2015-05-301-12/+14
| | |
* | | Issue #16991: Do not return None from OrderedDict.__reversed__.Eric Snow2015-05-301-3/+0
| | |
* | | Issue #16991: Properly handle return values in several places.Eric Snow2015-05-301-16/+43
| | |
* | | Reverting my previous commit.Yury Selivanov2015-05-301-104/+41
| | | | | | | | | | | | Something went horribly wrong when I was doing `hg rebase`.
* | | Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka2015-05-304-19/+46
|\ \ \ | | | | | | | | | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
| * \ \ Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka2015-05-304-19/+46
| |\ \ \ | | |/ / | | | | | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
| | * | Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka2015-05-304-15/+37
| | | | | | | | | | | | | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
* | | | Specify default values of semantic booleans in Argument Clinic generated ↵Serhiy Storchaka2015-05-302-4/+4
|\ \ \ \ | |/ / / | | | | | | | | signatures as booleans.
| * | | Specify default values of semantic booleans in Argument Clinic generated ↵Serhiy Storchaka2015-05-302-4/+4
| | | | | | | | | | | | | | | | signatures as booleans.
| * | | Issue #16991: Add a C implementation of collections.OrderedDict.Eric Snow2015-05-304-172/+2596
| | | |
* | | | Issue #16991: Add a C implementation of collections.OrderedDict.Eric Snow2015-05-304-172/+2596
| | | |
* | | | Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.Yury Selivanov2015-05-281-1/+1
|\ \ \ \ | |/ / /
| * | | Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.Yury Selivanov2015-05-281-1/+1
| | | |
* | | | Issue #23359: Specialize set_lookkey intoa lookup function and an insert ↵Raymond Hettinger2015-05-271-41/+104
|/ / / | | | | | | | | | function.
* | | Issue #24276: Fixed optimization of property descriptor getter.Serhiy Storchaka2015-05-241-4/+21
| | |
* | | Issue #24268: Address some PEP 489 refleaksNick Coghlan2015-05-232-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | - missing DECREF in PyModule_FromDefAndSpec2 - missing DECREF in PyType_FromSpecAndBases2 - missing DECREF in _testmultiphase module Patch by Petr Viktorin
* | | PEP 489: Multi-phase extension module initializationNick Coghlan2015-05-231-52/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Known limitations of the current implementation: - documentation changes are incomplete - there's a reference leak I haven't tracked down yet The leak is most visible by running: ./python -m test -R3:3 test_importlib However, you can also see it by running: ./python -X showrefcount Importing the array or _testmultiphase modules, and then deleting them from both sys.modules and the local namespace shows significant increases in the total number of active references each cycle. By contrast, with _testcapi (which continues to use single-phase initialisation) the global refcounts stabilise after a couple of cycles.
* | | Issue 24237: Raise PendingDeprecationWarning per PEP 479Yury Selivanov2015-05-221-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Raise PendingDeprecationWarning when generator raises StopIteration and no __future__ import is used. Fix offenders in the stdlib and tests. See also issue 22906. Thanks to Nick Coghlan and Berker Peksag for reviews.
* | | Issue #24257: Fixed incorrect uses of PyObject_IsInstance().Serhiy Storchaka2015-05-222-7/+5
|\ \ \ | |/ / | | | | | | | | | Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace.
| * | Issue #24257: Fixed incorrect uses of PyObject_IsInstance().Serhiy Storchaka2015-05-222-7/+5
| | | | | | | | | | | | | | | Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace.