summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)Mariusz Felisiak2021-07-261-1/+1
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44590: Lazily allocate frame objects (GH-27077)Mark Shannon2021-07-268-272/+433
| | | | | | | | | | | | | | * Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it. * Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector. * Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation. * Move ownership of InterpreterFrame in generator from frame object to generator object. * Do not create frame objects for Python calls. * Do not create frame objects for generators.
* bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346)Charles Burkland2021-07-251-4/+12
|
* bpo-43950: support some multi-line expressions for PEP 657 (GH-27339)Batuhan Taskaya2021-07-251-9/+28
| | | | | | | | | | | | | | | | | | | | | This is basically something that I noticed up while fixing test runs for another issue. It is really common to have multiline calls, and when they fail the display is kind of weird since we omit the annotations. E.g; ``` $ ./python t.py Traceback (most recent call last): File "/home/isidentical/cpython/cpython/t.py", line 11, in <module> frame_1() ^^^^^^^^^ File "/home/isidentical/cpython/cpython/t.py", line 5, in frame_1 frame_2( File "/home/isidentical/cpython/cpython/t.py", line 2, in frame_2 return a / 0 / b / c ~~^~~ ZeroDivisionError: division by zero ``` This patch basically adds support for annotating the rest of the line, if the instruction covers multiple lines (start_line != end_line). Automerge-Triggered-By: GH:isidentical
* bpo-44717: improve AttributeError on circular imports of submodules (GH-27338)Filipe Laíns2021-07-241-1732/+1749
|
* bpo-43950: check against the raw string, not the pyobject (GH-27337)Batuhan Taskaya2021-07-241-1/+1
|
* Revert "bpo-44717: improve AttributeError on circular imports of submodules ↵Pablo Galindo Salgado2021-07-241-1749/+1732
| | | | | (GH-27299)" (GH-27331) This reverts commit 8072a1181dd64135f700b44372fbf7bf91e68072.
* bpo-43950: ensure source_line is present when specialising the traceback ↵Batuhan Taskaya2021-07-241-2/+2
| | | | (GH-27313)
* bpo-44717: improve AttributeError on circular imports of submodules (GH-27299)Filipe Laíns2021-07-241-1732/+1749
| | | | | Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44611: Use BCryptGenRandom instead of CryptGenRandom on Windows (GH-27168)Dong-hee Na2021-07-231-40/+8
|
* bpo-44353: Implement typing.NewType __call__ method in C (#27262)Yurii Karabas2021-07-221-0/+1
| | | | Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Denis Laxalde <denis@laxalde.org>
* bpo-43950: Distinguish errors happening on character offset decoding (GH-27217)Batuhan Taskaya2021-07-201-0/+10
|
* bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216)Mark Shannon2021-07-191-1/+6
|
* bpo-20291: Fix MSVC warnings in getargs.c (GH-27211)Ken Jin2021-07-171-1/+2
| | | | | | | | | * Fix MSVC warnings in getargs.c * apply suggestions Co-Authored-By: Batuhan Taskaya <batuhan@python.org> Co-authored-by: Batuhan Taskaya <batuhan@python.org>
* bpo-44655: Include the name of the type in unset __slots__ attribute errors ↵Pablo Galindo Salgado2021-07-161-4/+9
| | | | (GH-27199)
* bpo-44655: Don't include suggestions for attributes that are the same as the ↵Pablo Galindo Salgado2021-07-161-0/+3
| | | | missing one (GH-27197)
* Revert "bpo-44645: Check for interrupts on any potentially backwards edge. ↵Pablo Galindo Salgado2021-07-161-6/+1
| | | | | (GH-27167)" (#27194) This reverts commit 000e70ad5246732fcbd27cf59268185cbd5ad734.
* bpo-20201: variadic arguments support for AC (GH-18609)Batuhan Taskaya2021-07-163-39/+277
| | | Implement support for `*args` in AC, and port `print()` to use it.
* bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)Mark Shannon2021-07-161-1/+6
|
* bpo-43950: make BinOp specializations more reliable (GH-27126)Batuhan Taskaya2021-07-151-1/+1
|
* bpo-44626: Merge basic blocks earlier to enable better handling of exit ↵Mark Shannon2021-07-153-4317/+4361
| | | | blocks without line numbers (GH-27138)
* Remove sys._deactivate_opcache() now that is not needed (GH-27154)Pablo Galindo Salgado2021-07-153-49/+1
|
* bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. ↵Mark Shannon2021-07-151-1/+3
| | | | (GH-27160)
* bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043)Irit Katriel2021-07-153-12/+174
|
* bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal ↵Jack DeVries2021-07-151-4/+41
| | | | keys (GH-27131)
* bpo-44616: Mark all clean up instructions at end of named exception block as ↵Mark Shannon2021-07-142-5/+4
| | | | artificial (GH-27109)
* bpo-33346: Allow async comprehensions inside implicit async comprehensions ↵Serhiy Storchaka2021-07-132-7/+16
| | | | | (GH-6766) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)Batuhan Taskaya2021-07-121-41/+225
| | | | Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)Mark Shannon2021-07-081-4/+2
|
* bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064)Mark Shannon2021-07-081-1/+9
|
* bpo-43895: Remove an unnecessary cache of shared object handles (GH-25487)Ian Henriksen2021-07-071-22/+0
| | | * Remove an unnecessary cache of shared object handles.
* bpo-43950: Add option to opt-out of PEP-657 (GH-27023)Ammar Askar2021-07-071-1/+20
| | | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)Gabriele N. Tornetta2021-07-077-7302/+7261
|
* bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)Ammar Askar2021-07-042-7/+68
| | | | | | | | The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location to print carets on the specific expressions involved in a traceback. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-43950: optimize column table assembling with pre-sizing object (GH-26997)Batuhan Taskaya2021-07-021-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The new resizing system works like this; ``` $ cat t.py a + a + a + b + c + a + a + a + b + c + a + a + a + b + c + a + a + a + b + c [repeated 99 more times] $ ./python t.py RESIZE: prev len = 32, new len = 66 FINAL SIZE: 56 ----------------------------------------------------- RESIZE: prev len = 32, new len = 66 RESIZE: prev len = 66, new len = 134 RESIZE: prev len = 134, new len = 270 RESIZE: prev len = 270, new len = 542 RESIZE: prev len = 542, new len = 1086 RESIZE: prev len = 1086, new len = 2174 RESIZE: prev len = 2174, new len = 4350 RESIZE: prev len = 4350, new len = 8702 FINAL SIZE: 8004 ``` So now we do considerably lower number of `_PyBytes_Resize` calls. Automerge-Triggered-By: GH:isidentical
* bpo-43950: Add code.co_positions (PEP 657) (GH-26955)Pablo Galindo2021-07-026-5138/+7118
| | | | | | | | | | | | | | | This PR is part of PEP 657 and augments the compiler to emit ending line numbers as well as starting and ending columns from the AST into compiled code objects. This allows bytecodes to be correlated to the exact source code ranges that generated them. This information is made available through the following public APIs: * The `co_positions` method on code objects. * The C API function `PyCode_Addr2Location`. Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-44313: bump up magic (#26983)Batuhan Taskaya2021-07-011-1/+1
|
* Add file describing how to add or modify specialized families of ↵Mark Shannon2021-07-012-0/+135
| | | | instructions. (GH-26954)
* bpo-44313: generate LOAD_ATTR/CALL_FUNCTION for top-level imported objects ↵Batuhan Taskaya2021-06-304-213/+236
| | | | (GH-26677)
* Fix compiler errors for unused variables in marshal.c (GH-26977)Pablo Galindo2021-06-301-2/+0
|
* bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and ↵Steve Dower2021-06-301-10/+20
| | | | marshal.dumps (GH-26961)
* bpo-12022: Change error type for bad objects in "with" and "async with" ↵Serhiy Storchaka2021-06-291-18/+30
| | | | | | | | | (GH-26809) A TypeError is now raised instead of an AttributeError in "with" and "async with" statements for objects which do not support the context manager or asynchronous context manager protocols correspondingly.
* Make sure that line number is set correctly for call to __exit__ when ↵Mark Shannon2021-06-244-4498/+4498
| | | | handling exception in body of a with statement. (GH-26890)
* bpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)Guido van Rossum2021-06-234-228/+228
| | | | | | All uses of this flag are either setting it or in doc or tests for it. So we should be able to get rid of it completely.
* bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)Victor Stinner2021-06-231-0/+3
| | | | | Py_RunMain() now resets PyImport_Inittab to its initial value at exit. It must be possible to call PyImport_AppendInittab() or PyImport_ExtendInittab() at each Python initialization.
* bpo-44486: Make sure that modules always have a dictionary. (GH-26847)Mark Shannon2021-06-231-0/+1
| | | * Make sure that modules always have a dictionary.
* bpo-43918: document signature and default argument of `anext` builtin (#25551)Erik Welch2021-06-222-4/+10
| | | Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-43693: Turn localspluskinds into an object (GH-26749)Guido van Rossum2021-06-216-5335/+5398
| | | Managing it as a bare pointer to malloc'ed bytes is just too awkward in a few places.
* bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)Pablo Galindo2021-06-211-0/+3
|
* bpo-44466: Faulthandler now detects the GC (GH-26823)Victor Stinner2021-06-211-0/+4
| | | | The faulthandler module now detects if a fatal error occurs during a garbage collector collection (only if all_threads is true).