summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-42174: fallback to sane values if the columns or lines are 0 in ↵Filipe Laíns2021-10-193-2/+8
| | | | | | | | | | | | | get_terminal_size (GH-29046) I considered only falling back when both were 0, but that still seems wrong, and the highly popular rich[1] library does it this way, so I thought we should probably inherit that behavior. [1] https://github.com/willmcgugan/rich Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-42222: Improve tests for invalid argument types in randrange() (GH-29021)Serhiy Storchaka2021-10-191-20/+11
|
* bpo-40360: Make the 2to3 deprecation more obvious. (GH-29064)Gregory P. Smith2021-10-192-3/+8
|
* bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047)Filipe Laíns2021-10-192-0/+4
| | | | | Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Add zoneinfo to the datetime documentation (GH-29038)Paul Ganssle2021-10-192-4/+9
| | | | | | We should have done this way back when 3.9 was released, but it fell off the radar. Co-authored-by: Paul Ganssle <git@m.ganssle.io>
* Record cache hits for BINARY_SUBSCR specializations (GH-29060)Ken Jin2021-10-191-0/+3
|
* bpo-42064: Add module backref to `sqlite3` callback context (GH-28242)Erlend Egeberg Aasland2021-10-193-125/+91
|
* bpo-43851: Build SQLite with SQLITE_OMIT_AUTOINIT on Windows (GH-25414)Erlend Egeberg Aasland2021-10-192-1/+2
|
* bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API (GH-29027)Victor Stinner2021-10-196-31/+19
| | | | | | | The Python 3.11 limited C API no longer includes stdlib.h, stdio.h, string.h and errno.h. * Exclude Py_MEMCPY() from Python 3.11 limited C API. * xxlimited C extension is now built with Python 3.11 limited C API.
* bpo-45475: Revert `__iter__` optimization for GzipFile, BZ2File, and ↵Inada Naoki2021-10-194-12/+4
| | | | | LZMAFile. (GH-29016) This reverts commit d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.
* bpo-45516: use documentation links in TraversableResources' description ↵Filipe Laíns2021-10-191-4/+5
| | | | | | | (GH-29045) I think this makes the documentation much more digestible :) Signed-off-by: Filipe Laíns <lains@riseup.net>
* bpo-35134: Add Include/cpython/longobject.h (GH-29044)Victor Stinner2021-10-1911-132/+135
| | | | | | | | | | Move Include/longobject.h non-limited API to a new Include/cpython/longobject.h header file. Move the following definitions to the internal C API: * _PyLong_DigitValue * _PyLong_FormatAdvancedWriter() * _PyLong_FormatWriter()
* bpo-35134: Split warnings.h and weakrefobject.h (GH-29042)Victor Stinner2021-10-1810-77/+100
| | | | | | | | | | | | | Split header files to move the non-limited API to Include/cpython/: * Include/warnings.h => Include/cpython/warnings.h * Include/weakrefobject.h => Include/cpython/weakrefobject.h Exclude PyWeakref_GET_OBJECT() from the limited C API. It never worked since the PyWeakReference structure is opaque in the limited C API. Move _PyWarnings_Init() and _PyErr_WarnUnawaitedCoroutine() to the internal C API.
* bpo-45516: add protocol description to the Traversable documentation (#29039)Filipe Laíns2021-10-182-0/+42
| | | | | | | | | | | | | | | | | * bpo-45516: add protocol description to the Traversable documentation Signed-off-by: Filipe Laíns <lains@riseup.net> * Update Doc/library/importlib.rst Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * Update Lib/importlib/abc.py * Update Doc/library/importlib.rst Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)andrei kulakov2021-10-182-0/+15
|
* bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)Victor Stinner2021-10-183-11/+11
| | | | | | * Rename _PyThreadState_DisableTracing() to _PyThreadState_PauseTracing() * Rename _PyThreadState_ResetTracing() to _PyThreadState_ResumeTracing()
* bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)Mark Shannon2021-10-183-179/+127
| | | | | | * Avoid making C calls for most calls to Python functions. * Change initialize_locals(steal=true) and _PyTuple_FromArraySteal to consume the argument references regardless of whether they succeed or fail.
* bpo-45434: Include stdlib.h for specialize stat (GH-29015)Dong-hee Na2021-10-181-1/+2
|
* Improve multiserver queue recipe (GH-29012)Raymond Hettinger2021-10-171-5/+6
|
* bpo-45229: Make test_http_cookiejar discoverable (GH-29004)Serhiy Storchaka2021-10-171-10/+1
|
* Fix contributor person name in rst files (GH-29005)Benjamin Szőke2021-10-172-3/+3
|
* bpo-45495: Add 'case' and 'match' to IDLE completions list. (GH-29000)Terry Jan Reedy2021-10-163-3/+13
| | | | Since the keyword list is frozen, only compute it once per session. The colorizer already handles context keywords.
* bpo-45020: Default to using frozen modules unless running from source tree. ↵Eric Snow2021-10-167-25/+91
| | | | | | | (gh-28940) The default was "off". Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything. There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used. https://bugs.python.org/issue45020
* bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)Pablo Galindo Salgado2021-10-163-1/+13
|
* bpo-42222: Remove deprecated support for non-integer values (GH-28983)Raymond Hettinger2021-10-164-87/+54
|
* bpo-45489: Update ForwardRef to support | operator. (GH-28991)Dong-hee Na2021-10-163-0/+14
|
* bpo-45463: Clarify that global statements allows multiple names (GH-28851)Luca Chiodini2021-10-161-4/+4
| | | | | | | The global statement allows specifying a list of identifiers (https://docs.python.org/3/reference/simple_stmts.html#the-global-statement). The "Execution model" chapter described the global statement as if it only allowed one single name. Pluralize "name" in the appropriate places.
* bpo-45442: Add deactivate step to venv tutorial. (GH-28981)srinivasan2021-10-151-0/+5
| | | | | | | @vsajip Sorry for the trouble—made a [fairly significant] git error in the previous PR. Have edited the patch as you had said in #28959. Automerge-Triggered-By: GH:vsajip
* bpo-45440: Remove pymath.c fallbacks (GH-28977)Victor Stinner2021-10-158-90/+9
| | | | | | | | Remove fallbacks for missing round(), copysign() and hypot() in Python/pymath.c. Python now requires these functions to build. These fallbacks were needed on Visual Studio 2012 and older. They are no longer needed since Visual Stuido 2013. Python is now built with Visual Studio 2017 or newer since Python 3.6.
* bpo-30459: Use (void) in macros setting variables (GH-28982)Victor Stinner2021-10-152-4/+4
| | | | | | | | Convert the result of macros setting variables to void to avoid risks of misusing them: * _PyGCHead_SET_NEXT() * asdl_seq_SET() * asdl_seq_SET_UNTYPED()
* bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)Victor Stinner2021-10-159-25/+146
| | | | | | | | | | Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() functions to the limited C API to suspend and resume tracing and profiling. Add an unit test on the PyThreadState C API to _testcapi. Add also internal _PyThreadState_DisableTracing() and _PyThreadState_ResetTracing().
* bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)Victor Stinner2021-10-1514-40/+45
| | | | | | | | | Rename Include/namespaceobject.h to Include/internal/pycore_namespace.h. The _testmultiphase extension is now built with the Py_BUILD_CORE_MODULE macro defined to access _PyNamespace_Type. object.c: remove unused "pycore_context.h" include.
* bpo-44113: Move the What's New entry to Deprecate section (GH-28974)Victor Stinner2021-10-151-7/+7
|
* bpo-45445: Remove incorrectly commited test file (GH-28972)Pablo Galindo Salgado2021-10-151-3/+0
|
* bpo-45434: Remove Include/eval.h header file (GH-28973)Victor Stinner2021-10-1511-47/+26
| | | | Move Include/eval.h content into Include/ceval.h and Include/cpython/ceval.h, and remove Include/eval.h.
* bpo-35081: Move interpreteridobject.h to Include/internal/ (GH-28969)Victor Stinner2021-10-1511-35/+26
| | | | Move the interpreteridobject.h header file from Include/ to Include/internal/. It only provides private functions.
* bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)Graham Inggs2021-10-152-1/+2
| | | Strip trailing '\n'.
* bpo-35134: Move classobject.h to Include/cpython/ (GH-28968)Victor Stinner2021-10-1515-45/+39
| | | | | | | | | Move classobject.h, context.h, genobject.h and longintrepr.h header files from Include/ to Include/cpython/. Remove redundant "#ifndef Py_LIMITED_API" in context.h. Remove explicit #include "longintrepr.h" in C files. It's not needed, Python.h already includes it.
* bpo-45479: Futher simplify Py_UniversalNewlineFgets. (GH-28967)Benjamin Peterson2021-10-151-23/+9
| | | Thank you to Eryk Sun for the suggestions in https://github.com/python/cpython/pull/28965#discussion_r729527143.
* closes bpo-45479: Degunkify Py_UniversalNewlineFgets. (GH-28965)Benjamin Peterson2021-10-151-32/+5
| | | Remove dead variables and control flow.
* bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964)Victor Stinner2021-10-157-14/+17
|
* po-35134: Move Include/funcobject.h to Include/cpython/ (GH-28958)Victor Stinner2021-10-148-10/+16
| | | Remove redundant "#ifndef Py_LIMITED_API" in funcobject.h.
* bpo-45434: Remove useless space in includes (GH-28963)Victor Stinner2021-10-1424-28/+26
| | | Micro-optimize spaces!
* bpo-41710: Fix What's New Entry credit (GH-28962)Victor Stinner2021-10-141-1/+1
| | | Fix bad copy/paste.
* bpo-45434: Limited Python.h no longer includes stdio.h (GH-28960)Victor Stinner2021-10-143-7/+16
| | | | The <Python.h> header file no longer includes <stdio.h> if the Py_LIMITED_API macro is defined.
* bpo-45474: Fix the limited C API of marshal.h (GH-28956)Victor Stinner2021-10-143-6/+27
| | | | | | | | | | Remove two functions from the limited C API: * PyMarshal_WriteLongToFile() * PyMarshal_WriteObjectToFile() The PEP 384 excludes functions expecting "FILE*" from the stable ABI. Remove also the Py_MARSHAL_VERSION macro from the limited C API.
* bpo-35134: Add Include/cpython/floatobject.h (GH-28957)Victor Stinner2021-10-1414-79/+123
| | | | | Split Include/floatobject.h into sub-files: add Include/cpython/floatobject.h and Include/internal/pycore_floatobject.h.
* bpo-21736: Set __file__ on frozen stdlib modules. (gh-28656)Eric Snow2021-10-147-94/+240
| | | | | | | | | | | | | | | | | | | | | | | | Currently frozen modules do not have __file__ set. In their spec, origin is set to "frozen" and they are marked as not having a location. (Similarly, for frozen packages __path__ is set to an empty list.) However, for frozen stdlib modules we are able to extrapolate __file__ as long as we can determine the stdlib directory at runtime. (We now do so since gh-28586.) Having __file__ set is helpful for a number of reasons. Likewise, having a non-empty __path__ means we can import submodules of a frozen package from the filesystem (e.g. we could partially freeze the encodings module). This change sets __file__ (and adds to __path__) for frozen stdlib modules. It uses sys._stdlibdir (from gh-28586) and the frozen module alias information (from gh-28655). All that work is done in FrozenImporter (in Lib/importlib/_bootstrap.py). Also, if a frozen module is imported before importlib is bootstrapped (during interpreter initialization) then we fix up that module and its spec during the importlib bootstrapping step (i.e. imporlib._bootstrap._setup()) to match what gets set by FrozenImporter, including setting the file info (if the stdlib dir is known). To facilitate this, modules imported using PyImport_ImportFrozenModule() have __origname__ set using the frozen module alias info. __origname__ is popped off during importlib bootstrap. (To be clear, even with this change the new code to set __file__ during fixups in imporlib._bootstrap._setup() doesn't actually get triggered yet. This is because sys._stdlibdir hasn't been set yet in interpreter initialization at the point importlib is bootstrapped. However, we do fix up such modules at that point to otherwise match the result of importing through FrozenImporter, just not the __file__ and __path__ parts. Doing so will require changes in the order in which things happen during interpreter initialization. That can be addressed separately. Once it is, the file-related fixup code from this PR will kick in.) Here are things this change does not do: * set __file__ for non-stdlib modules (no way of knowing the parent dir) * set __file__ if the stdlib dir is not known (nor assume the expense of finding it) * relatedly, set __file__ if the stdlib is in a zip file * verify that the filename set to __file__ actually exists (too expensive) * update __path__ for frozen packages that alias a non-package (since there is no package dir) Other things this change skips, but we may do later: * set __file__ on modules imported using PyImport_ImportFrozenModule() * set co_filename when we unmarshal the frozen code object while importing the module (e.g. in FrozenImporter.exec_module()) -- this would allow tracebacks to show source lines * implement FrozenImporter.get_filename() and FrozenImporter.get_source() https://bugs.python.org/issue21736
* bpo-45417: [Enum] fix quadratic behavior during creation (GH-28907)Carl Friedrich Bolz-Tereick2021-10-142-7/+16
| | | | | | | | | | | | Creating an Enum exhibited quadratic behavior based on the number of members in three places: - `EnumDict._member_names`: a list searched with each new member's name - member creation: a `for` loop checking each existing member to see if new member was a duplicate - `auto()` values: a list of all previous values in enum was copied before being sent to `_generate_next_value()` Two of those issues have been resolved: - `_EnumDict._member_names` is now a dictionary so lookups are fast - member creation tries a fast value lookup before falling back to the slower `for` loop lookup The third issue still remains, as `_generate_next_value_()` can be user-overridden and could corrupt the last values list if it were not copied.
* bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)Eric Snow2021-10-142-5/+7
| | | | | The change in gh-28586 (bpo-45211) should not have included code to set _Py_path_config.stdlib_dir in Py_SetPythonHome(). We fix that here. https://bugs.python.org/issue45471