summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046)Miss Islington (bot)2022-03-141-3/+3
| | | | | (cherry picked from commit e3d348a5252549708fd19338b675a2c23b60d677) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.10] bpo-46940: Don't override existing AttributeError suggestion ↵Pablo Galindo Salgado2022-03-071-12/+22
| | | | | | | | | | | | | | | information (GH-31710) (GH-31724) When an exception is created in a nested call to PyObject_GetAttr, any external calls will override the context information of the AttributeError that we have already placed in the most internal call. This will cause the suggestions we create to nor work properly as the attribute name and object that we will be using are the incorrect ones. To avoid this, we need to check first if these attributes are already set and bail out if that's the case.. (cherry picked from commit 3b3be05a164da43f201e35b6dafbc840993a4d18) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-46852: Rename float.__set_format__() to float.__setformat__() (GH-31558) ↵Victor Stinner2022-02-252-17/+17
| | | | | | | | | | | | | | | (GH-31578) Rename the private undocumented float.__set_format__() method to float.__setformat__() to fix a typo introduced in Python 3.7. The method is only used by test_float. The change enables again test_float tests on the float format which were previously skipped because of the typo. The typo was introduced in Python 3.7 by bpo-20185 in commit b5c51d3dd95bbfde533655fb86ac0f96f771ba7b. (cherry picked from commit 7d03c8be5af2f1559dbc35b775b3116dfd63cfb6)
* [3.10] bpo-46732: fix __bool__ docstring (GH-31301) (GH-31473)Miss Islington (bot)2022-02-211-1/+1
| | | | | | (cherry picked from commit 0a222db2bca63070f429c0e613707da1bdfaf0e0) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46615: Don't crash when set operations mutate the sets (GH-31120)Miss Islington (bot)2022-02-111-8/+39
| | | | | | Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called. (cherry picked from commit 4a66615ba736f84eadf9456bfd5d32a94cccf117) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* [3.10] bpo-46433: _PyType_GetModuleByDef: handle static types in MRO ↵Petr Viktorin2022-02-111-9/+7
| | | | | | | (GH-30696) (GH-31262) (cherry picked from commit 0ef08530124c5ca13a9394f4ac18bee8e6c66409)
* bpo-46417: Fix race condition on setting type __bases__ (GH-30788) (GH-30789)Miss Islington (bot)2022-01-221-11/+16
| | | | | | | | | | | | Fix a race condition on setting a type __bases__ attribute: the internal function add_subclass() now gets the PyTypeObject.tp_subclasses member after calling PyWeakref_NewRef() which can trigger a garbage collection which can indirectly modify PyTypeObject.tp_subclasses. (cherry picked from commit f1c6ae3270913e095d24ae13ecf96f5a32c8c503) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* docs: correct outdated MappingProxyType docstrings (GH-30281)Miss Islington (bot)2022-01-191-3/+3
| | | | | | | | The docstrings for MappingProxyType's keys(), values(), and items() methods were never updated to reflect the changes that Python 3 brought to these APIs, namely returning views rather than lists. (cherry picked from commit 2d10fa9bc4cf83c5e5dd73decc9a138d6d247374) Co-authored-by: Joshua Bronson <jabronson@gmail.com>
* [3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings ↵Victor Stinner2022-01-062-17/+68
| | | | | | | | | | | | | | | | | (GH-20085)" (GH-30422) (GH-30425) This reverts commit ea251806b8dffff11b30d2182af1e589caf88acf. Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for the main interpreter. Keep _PyUnicode_ClearInterned() changes avoiding the creation of a temporary Python list object. Leave the PyInterpreterState structure unchanged to keep the ABI backward compatibility with Python 3.10.0: rename the "interned" member to "unused_interned". (cherry picked from commit 35d6540c904ef07b8602ff014e520603f84b5886)
* bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)Miss Islington (bot)2022-01-051-22/+33
| | | | | | Automerge-Triggered-By: GH:pablogsal (cherry picked from commit 46e4c257e7c26c813620232135781e6c53fe8d4d) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290)Miss Islington (bot)2021-12-301-3/+5
| | | | | (cherry picked from commit fb44d0589615590b1e7895ba78a038e96b15a219) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* [3.10] bpo-46009: Do not exhaust generator when send() method raises ↵Mark Shannon2021-12-081-0/+13
| | | | | | | | | | | | (GH-29986). (GH-29988) * [3.10] bpo-46009: Do not exhaust generator when send() method raises (GH-29986). (cherry picked from commit 69806b9516dbe092381f3ef884c7c64bb9b8414a) Co-authored-by: Mark Shannon <mark@hotpy.org> * Rename variable after cherry-pick. * Add NULL check.
* bpo-45392: Update the docstring of the 'type' built-in (GH-29439) (GH-29452)Miss Islington (bot)2021-11-061-3/+1
| | | | | (cherry picked from commit 91275207296c39e495fe118019a757c4ddefede8) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)Miss Islington (bot)2021-10-221-6/+14
| | | | | | | | * Use Py_EnterRecursiveCall() in issubclass() Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google] (cherry picked from commit 423fa1c1817abfa8c3d1bc308ddbbd8f28b69d68) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-45521: Fix a bug in the obmalloc radix tree code. (GH-29051) (GH-29122)Miss Islington (bot)2021-10-211-1/+1
| | | | | | MAP_BOT_LENGTH was incorrectly used to compute MAP_TOP_MASK instead of MAP_TOP_LENGTH. On 64-bit machines, the error causes the tree to hold 46-bits of virtual addresses, rather than the intended 48-bits. (cherry picked from commit 311910b31a4bd94dc79298388b7cb65ca5546438)
* [3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-20/+44
| | | | | | | | | | | "raw-unicode-escape" codec (GH-28944) (GH-28952) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.raw_unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit 39aa98346d5dd8ac591a7cafb467af21c53f1e5d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the ↵Miss Islington (bot)2021-10-141-12/+37
| | | | | | | | | | | | "unicode-escape" codec (GH-28939) (GH-28943) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit c96d1546b11b4c282a7e21737cb1f5d16349656d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] Fix typos in the Objects directory (GH-28766) (GH-28797)Christian Clauss2021-10-076-7/+7
| | | | | (cherry picked from commit 5f401f10400123afa9171548c432ea3fc37c0736) Automerge-Triggered-By: GH:JulienPalard
* bpo-45385: Fix reference leak from descr_check (GH-28719) (GH-28779)Miss Islington (bot)2021-10-071-39/+37
|
* [3.10] bpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720). (GH-28721)Serhiy Storchaka2021-10-041-2/+2
| | | | (cherry picked from commit 252b7bcb236dc261f3af1275bc90f9a303d9648f)
* [3.10] bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size ↵Serhiy Storchaka2021-10-041-2/+2
| | | | | | of the code unit (GH-28711). (GH-28718) (cherry picked from commit 60b9e040c9cf40e69f42c0008e564458aa0379e8)
* [3.10] Remove trailing spaces (GH-28709)Serhiy Storchaka2021-10-033-3/+3
|
* Fix spelling error in comment (GH-28696) (GH-28699)Miss Islington (bot)2021-10-021-1/+1
|
* [3.10] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28511)Łukasz Langa2021-09-211-1/+1
| | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* bpo-44640: Improve punctuation consistency in isinstance/issubclass error ↵Miss Islington (bot)2021-09-191-2/+2
| | | | | | | | | | messages (GH-27144) (GH-28436) Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit f4813388b4506b2fafb0089848c5b11cd503758c) Co-authored-by: wyz23x2 <52805709+wyz23x2@users.noreply.github.com> Co-authored-by: wyz23x2 <52805709+wyz23x2@users.noreply.github.com>
* bpo-45198: __set_name__ documentation not clear about its usage with ↵Miss Islington (bot)2021-09-181-1/+2
| | | | | | | non-descriptor classes (GH-28439) (cherry picked from commit 94b462686b7dfabbd69cc9401037d736d71c4dc2) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28367)Miss Islington (bot)2021-09-151-0/+2
| | | | | (cherry picked from commit 5dce51a8875d9639786741e962b3cb208596b096) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-45083: Include the exception class qualname when formatting an ↵Miss Islington (bot)2021-09-081-0/+8
| | | | | | | | | | | | exception (GH-28119) (GH-28134) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> (cherry picked from commit b4b6342848ec0459182a992151099252434cc619) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> * Use a private version of _PyType_GetQualName Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) ↵Miss Islington (bot)2021-09-071-7/+5
| | | | | | | (GH-28199) Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`.
* bpo-44963: Implement send() and throw() methods for anext_awaitable objects ↵Miss Islington (bot)2021-09-071-22/+96
| | | | | | | | (GH-27955) Co-authored-by: Yury Selivanov <yury@edgedb.com> (cherry picked from commit 533e725821b15e2df2cd4479a34597c1d8faf616) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)Miss Islington (bot)2021-09-041-16/+18
| | | | | | | It happened with fast range iterator when the calculated stop = start + step * len was out of the C long range. (cherry picked from commit 936f6a16b9ef85bd56b18a247b962801e954c30e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)Miss Islington (bot)2021-08-281-1/+1
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 94a3d2a6329ab7941e93ad2f5bcbb8af2b8b80d2) Co-authored-by: chilaxan <chilaxan@gmail.com>
* bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834)Miss Islington (bot)2021-08-201-2/+2
| | | | | (cherry picked from commit 60b93d9e4922eeae25052bc15909d1f4152babde) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-44698: Restore complex pow behaviour for small integral exponents ↵Miss Islington (bot)2021-08-171-21/+7
| | | | | | | (GH-27772) (GH-27796) (cherry picked from commit 4b9a2dcf19e5d13c3bc2afea2de1f65cd994c699) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* bpo-33930: Fix segfault with deep recursion when cleaning method objects ↵Miss Islington (bot)2021-08-111-1/+5
| | | | | | | (GH-27678) (GH-27719) (cherry picked from commit bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-44872: use new trashcan macros in framobject.c (GH-27683) (GH-27690)Irit Katriel2021-08-101-2/+2
|
* bpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461)Miss Islington (bot)2021-07-301-1/+23
| | | | | | Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 8182c8329c709f42218a8a17d81639ece5b7b627) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
* bpo-44707: Fix an undefined behavior of the null pointer arithmetic ↵Miss Islington (bot)2021-07-291-2/+9
| | | | | | | (GH-27292) (GH-27442) (cherry picked from commit e5c8ddb1714fb51ab1defa24352c98e0f01205dc) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-41103: Resurrect the old buffer protocol. (GH-27437) (GH-27441)Miss Islington (bot)2021-07-291-0/+79
| | | | | | | | Revert "bpo-41103: Remove old buffer protocol support (GH-21117)" This reverts commit 6f8a6ee59cb7f99f68df8ee9c3e8c8cf19af3eed. (cherry picked from commit ce5e1a6809b714eb0383219190a076d9f883e008) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION ↵Miss Islington (bot)2021-07-281-1/+1
| | | | | | | (GH-27202) (cherry picked from commit ddf8ae31a0f371eff2db14c7f7a45976b86d56ea) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-34013: Move the Python 2 hints from the exception constructor to the ↵Miss Islington (bot)2021-07-271-201/+0
| | | | | | | parser (GH-27392) (cherry picked from commit ecc3c8e4216958d85385bf2467441c975128f26c) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) ↵Miss Islington (bot)2021-07-261-8/+15
| | | | | | | (#27366) (cherry picked from commit 1d582bbc969e05896addf97844ddf17ce9830e5e) Co-authored-by: T. Wouters <thomas@python.org>
* bpo-44732: Rename types.Union to types.UnionType (GH-27342)Miss Islington (bot)2021-07-261-3/+3
| | | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 2b8ad9e6c5f0a66e9ca2d15f85336d8a3eefefb0) Co-authored-by: Hasan <hasan.aleeyev@gmail.com>
* bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)Miss Islington (bot)2021-07-241-48/+0
| | | | | | | Remove also the _from_args() constructor. (cherry picked from commit 435a0334d341e5f8faed594d9f015746bb7845db) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)Ken Jin2021-07-241-81/+7
| | | | | Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)Pablo Galindo Salgado2021-07-241-0/+51
| | | | | (cherry picked from commit fe13f0b0f696464dd6f283576668dbf57cb11399) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
* bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ ↵Miss Islington (bot)2021-07-241-0/+6
| | | | | | | (GH-27316) (GH-27324) (cherry picked from commit 5370f0a82aaa4ba617070d5c71d2b18236096ac0) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make ↵Miss Islington (bot)2021-07-233-30/+6
| | | | | | | | | | | | | | | Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) (GH-27306) * Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG The field is always present in the type struct, as explained in the added comment. * Remove Py_TPFLAGS_HAVE_AM_SEND The flag is not needed, and since it was added in 3.10 it can be removed now. (cherry picked from commit a4760cc32d9e5dac7be262e9736eb30502cd7be3) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* bpo-44653: Support typing types in parameter substitution in the union type. ↵Miss Islington (bot)2021-07-221-13/+12
| | | | | | | (GH-27247) (#27296) (cherry picked from commit 2e3744d50b6e30ea24351e55b4352dcc58fd469e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44633: Fix parameter substitution of the union type with wrong types. ↵Miss Islington (bot)2021-07-181-16/+28
| | | | | | | | | (GH-27218) (GH-27224) A TypeError is now raised instead of returning NotImplemented. (cherry picked from commit 3ea5332a4365bdd771286b3e9692495116e9ceef) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>