Commit Graph

26868 Commits

Author SHA1 Message Date
Victor Stinner 7a56a4148c
gh-104212: Explain how to port imp code to importlib (#105905) 2023-06-19 16:13:11 +02:00
Alex Waygood 4426279a43
typing docs: Improve the intro to each section (#105901) 2023-06-19 00:54:29 +01:00
Erlend E. Aasland 6849acb3fe
gh-105875: Require SQLite 3.15.2 or newer (#105876)
SQLite 3.15.2 was released 2016-11-28.
2023-06-19 00:29:08 +02:00
Hugo van Kemenade bc07c8f096
Docs: move sphinx-lint to pre-commit (#105750) 2023-06-18 11:52:05 +00:00
Erlend E. Aasland dba7217511
gh-105844: Use devguide terminology to denote versions (#105882) 2023-06-18 12:25:23 +02:00
Irit Katriel 14d01262da
gh-105481: remove HAS_ARG, HAS_CONST, IS_JUMP_OPCODE, IS_PSEUDO_OPCODE and replace by their new versions (#105865) 2023-06-17 17:00:16 +01:00
Carl Meyer b356a4749a
gh-105678: document SET_FUNCTION_ATTRIBUTE (#105843) 2023-06-16 12:36:59 -05:00
Erlend E. Aasland 0bffe1acd7
gh-105844: Consistently use 'minor version' for X.Y versions (#105851) 2023-06-16 10:41:47 +02:00
chgnrdv 0d0963737a
Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (#104969) 2023-06-16 07:10:59 +00:00
Alex Doe 486b52a315
bpo-44530: Document the change in MAKE_FUNCTION behavior (#93189)
* bpo-44530: Document the change in MAKE_FUNCTION behavior

Fixes dis module documentation for MAKE_FUNCTION due to 2f180ce2cb (bpo-44530, released as part of 3.11) removes the qualified name at TOS
2023-06-15 19:04:57 -05:00
Alex Waygood da911a6b22
More reorganisation of the typing docs (#105787) 2023-06-15 06:52:18 +01:00
Alex Waygood 006a453205
Improve docs for `typing.dataclass_transform` (#105792) 2023-06-15 06:51:42 +01:00
Mark Shannon 1d857da7f0
GH-77273: Better bytecodes for f-strings (GH-6132) 2023-06-14 16:15:08 +01:00
Alex Waygood 7b1f0f204a
gh-105570: Deprecate unusual ways of creating empty TypedDicts (#105780)
Deprecate two methods of creating typing.TypedDict classes with 0 fields using the functional syntax: `TD = TypedDict("TD")` and `TD = TypedDict("TD", None)`. Both will be disallowed in Python 3.15. To create a TypedDict class with 0 fields, either use `class TD(TypedDict): pass` or `TD = TypedDict("TD", {})`.
2023-06-14 14:58:41 +00:00
TATHAGATA ROY d32e8d6070
gh-105196: Fix indentations of section headings in C API docs (#105672) 2023-06-14 15:21:30 +01:00
Alex Waygood 4a113e24a3
Typing docs: move the deprecated stuff below the non-deprecated stuff (#105781) 2023-06-14 15:19:27 +01:00
Alex Waygood ad56340b66
gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes (#105609)
Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead.

Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`.
2023-06-14 13:38:49 +01:00
Jelle Zijlstra fc8037d84c
gh-104873: Add typing.get_protocol_members and typing.is_protocol (#104878)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-14 05:35:06 -07:00
Nikita Sobolev 67f69dba0a
gh-105687: Remove deprecated objects from `re` module (#105688) 2023-06-14 12:26:20 +02:00
Jelle Zijlstra 5cdd5ba49d
tarfile: Fix positional-only syntax in docs (GH-105770)
The syntax used in the current docs (a / before any args) is invalid.

I think the right approach is for the arguments to arbitrary
filter functions to be treated as positional-only, meaning that users
can supply filter functions with any names for the argument. tarfile.py
only calls the filter function with positional arguments.
2023-06-14 09:26:48 +02:00
Victor Stinner b542972dc1
gh-105387: Limited C API implements Py_INCREF() as func (#105388)
In the limited C API version 3.12, Py_INCREF() and Py_DECREF()
functions are now implemented as opaque function calls to hide
implementation details.
2023-06-14 02:33:00 +02:00
zentarim f3266c05b6
GH-104554: Add RTSPS support to `urllib/parse.py` (#104605)
* GH-104554: Add RTSPS support to `urllib/parse.py`

RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-06-13 16:45:47 -07:00
Victor Stinner 457a459c78
gh-98040: Fix importbench: use types.ModuleType() (#105743)
Replace removed imp.new_module(name) with types.ModuleType(name).
2023-06-14 00:32:12 +02:00
Victor Stinner 2211454fe2
gh-105733: Deprecate ctypes SetPointerType() and ARRAY() (#105734) 2023-06-13 18:16:26 +00:00
Victor Stinner d0f1afd942
gh-105373: Remove PyArg_Parse() deprecation (#105394)
There is no plan to deprecate PyArg_Parse().

The deprecation was added as a comment in the C API documentation in
2007 by commit 85eb8c103c.
2023-06-13 13:49:36 +02:00
Lysandros Nikolaou ed8217b493
gh-105713: Document that tokenize raises when mixing tabs/spaces (#105723)
* gh-105713: Document that tokenize raises when mixing tabs/spaces
* Update Doc/whatsnew/3.12.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-13 12:39:29 +02:00
Jay f0fb782ddb
gh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (#105641)
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-06-12 20:29:02 +00:00
Petr Viktorin 2b90796be6
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) 2023-06-12 17:45:49 +02:00
Tomas R 18d16e93b6
gh-102676: Add more convenience properties to `dis.Instruction` (#103969)
Adds start_offset, cache_offset, end_offset, baseopcode,
baseopname, jump_target and oparg to dis.Instruction.

Also slightly improves the disassembly output by allowing
opnames to overflow into the space reserved for opargs.
2023-06-11 08:50:34 -07:00
Hugo van Kemenade cc879481e2
gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760) 2023-06-11 03:17:35 -06:00
Gregory P. Smith 3a314f7c3d
gh-99108: Mention HACL\* in the hashlib docs. (#105634) 2023-06-10 12:09:20 -07:00
Gregory P. Smith 0d1d6ab966
Cleanup and clarify our hashlib docs. (#105624)
Clarify and improve our hashlib docs. Now with 50% less mess!
2023-06-10 11:49:06 -07:00
Pablo Galindo Salgado 1dd267af64
Clarify the supported cases in the tokenize module (#105569) 2023-06-09 16:59:37 +01:00
Alex Waygood 8e755923c9
Miscellaneous improvements to the typing docs (#105529)
Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
2023-06-09 15:08:57 +00:00
Victor Stinner 58e4b69f69
gh-102304: Remove Py_INCREF() doc change (#105552)
Py_INCREF() was made compatible again with Python 3.9 and older in
the limited API of Python debug mode.
2023-06-09 11:56:03 +02:00
Nikita Sobolev 947ec7ab02
gh-105545: Remove deprecated `MacOSXOSAScript._name` (gh-105546) 2023-06-09 08:52:58 +00:00
Victor Stinner 3e525d2212
gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)
Deprecate the PyImport_ImportModuleNoBlock() function which is just
an alias to PyImport_ImportModule() since Python 3.3.
2023-06-09 10:30:57 +02:00
Nikita Sobolev 4ff5690e59
gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348)
* revert enum pickling from by-name to by-value

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-06-08 11:40:15 -07:00
Alex Waygood d213c2990f
Further improve docs for `typing.Annotated` (#105498) 2023-06-08 14:36:30 +00:00
Alex Waygood fbdee000de
gh-90015: Document that PEP-604 unions do not support forward references (#105366) 2023-06-07 18:26:23 +01:00
Alex Waygood d63a7c3694
typing: Improve documentation of generic classes and aliases (#105369) 2023-06-07 14:02:40 +00:00
Alex Waygood e26d296984
gh-97797: Improve documentation for typing.Annotated (#105365) 2023-06-07 06:35:34 -07:00
Alex Waygood c5ec51ec8f
Improve docs for `typing.TypeAlias` (#105372) 2023-06-07 06:31:02 -07:00
Pablo Galindo Salgado ffd2654550
gh-105390: Correctly raise TokenError instead of SyntaxError for tokenize errors (#105399) 2023-06-07 12:04:40 +01:00
Alex Waygood 81c81328a4
Improve code examples in `typing.rst` (#105346) 2023-06-07 07:47:11 +01:00
Alex Waygood d7645124f5
typing docs: Make the PEPs list an expandable section, hidden by default (#105353)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-07 07:37:02 +01:00
achhina 3e7316d7e8
GH-95088: Clarify rules for parsing an item key for format strings (#103779)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-06 19:01:36 -07:00
Alex Waygood 5f65ff0370
`typing.NewType` docs: the future performance improvements are now in the past (#105354) 2023-06-06 17:18:09 -07:00
Barney Gale 24af45172f
GH-102613: Fast recursive globbing in `pathlib.Path.glob()` (GH-104512)
This commit introduces a 'walk-and-match' strategy for handling glob patterns that include a non-terminal `**` wildcard, such as `**/*.py`. For this example, the previous implementation recursively walked directories using `os.scandir()` when it expanded the `**` component, and then **scanned those same directories again** when expanded the `*.py` component. This is wasteful.

In the new implementation, any components following a `**` wildcard are used to build a `re.Pattern` object, which is used to filter the results of the recursive walk. A pattern like `**/*.py` uses half the number of `os.scandir()` calls; a pattern like `**/*/*.py` a third, etc.

This new algorithm does not apply if either:

1. The *follow_symlinks* argument is set to `None` (its default), or
2. The pattern contains `..` components.

In these cases we fall back to the old implementation.

This commit also replaces selector classes with selector functions. These generators directly yield results rather calling through to their successors. A new internal `Path._glob()` method takes care to chain these generators together, which simplifies the lazy algorithm and slightly improves performance. It should also be easier to understand and maintain.
2023-06-06 23:50:36 +01:00
Victor Stinner 2587b9f64e
gh-105382: Remove urllib.request cafile parameter (#105384)
Remove cafile, capath and cadefault parameters of the
urllib.request.urlopen() function, deprecated in Python 3.6.
2023-06-06 21:17:45 +00:00
Victor Stinner d3a0eacbf3
gh-82180: Update math.factorial(float) doc for Python 3.10 (#105385) 2023-06-06 21:47:57 +02:00
Victor Stinner dfe9fc1904
gh-105373: Fix decimal documentation formatting (#105395)
The deprecation is on decimal.HAVE_THREADS, not on the whole module.
2023-06-06 21:43:35 +02:00
Raymond Hettinger 423459be2f
sliding_window() recipe: Raise ValueError for non-positive window sizes. Add more tests. (GH-105403) 2023-06-06 13:44:45 -05:00
Victor Stinner 6c54e5d721
gh-105376: Remove logging.Logger.warn() method (#105377) 2023-06-06 18:35:51 +00:00
Victor Stinner 2b8e6e5712
gh-94172: Update keyfile removal documentation (#105392)
Remove the "deprecated:: 3.6" markup, since the parameters (like
keyfile and certfile) got removed in Python 3.12.
2023-06-06 20:14:06 +02:00
Nikita Sobolev 3907de12b5
gh-92658: Fix typo in docs and tests for `HV_GUID_PARENT` (GH-105267) 2023-06-06 17:11:19 +01:00
Victor Stinner 3a975b5e92
gh-102304: Document Py_INCREF() change in What's New in Python 3.12 (#105389)
Not in Python 3.13.
2023-06-06 16:50:58 +02:00
Victor Stinner 04181965cf
gh-105156: Update Unicode C API: remove deprecation (#105379)
_PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),
_PyUnicode_ToTitlecase() are no longer deprecated in the
documentation. It's no longer needed since they now use Py_UCS4 type,
rather than the deprecated Py_UNICODE type.
2023-06-06 16:42:49 +02:00
Victor Stinner 0cb6b9b0db
gh-104783: Remove locale.resetlocale() function (#104784) 2023-06-06 14:55:50 +02:00
dependabot[bot] 963099ebd9
build(deps): bump requests from 2.29.0 to 2.31.0 in /Doc (#105368)
Bumps [requests](https://github.com/psf/requests) from 2.29.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.29.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 14:35:51 +02:00
Victor Stinner 0202aa002e
gh-102304: Fix up Simple ABI doc (GH-105351) 2023-06-06 13:03:51 +02:00
Victor Stinner 8ddf0dd264
gh-105268: Remove _PyGC_FINALIZED() macro (#105350)
Remove the old private, undocumented and untested _PyGC_FINALIZED()
macro which was kept for backward compatibility with Python 3.8 and
older.
2023-06-06 11:54:23 +02:00
Irit Katriel f4d8e10d0d
gh-105292: Add option to make traceback.TracebackException.format_exception_only recurse into exception groups (#105294)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-06-06 11:26:18 +02:00
Victor Stinner 92022d8416
gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)
When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
  _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.
2023-06-06 11:15:09 +02:00
Victor Stinner bae415ad02
gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)
* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:

  - Lib/test/test_stable_abi_ctypes.py
  - PC/python3dll.c
2023-06-06 08:40:32 +00:00
Jakub Kuczys a4f72fa39a
gh-89412: Add missing attributes (added in 3.10) to traceback module docs (#105046) 2023-06-05 18:10:13 +02:00
Hugo van Kemenade eb0ce92141
What's New in 3.12: List 'Improved Modules' alphabetically (#105315) 2023-06-05 18:04:11 +03:00
Inada Naoki 1237fb6a4b
gh-80480: array: Add 'w' typecode. (#105242) 2023-06-04 16:45:00 +00:00
Joe Geisbauer 5a5ed7a3e6
gh-104882: Docs: fix description of relationship between `socket.getblocking()` and `socket.gettimeout()` (#105026) 2023-06-04 16:59:16 +01:00
Shantanu 9a90c9ace2
Fix typo in Python 3.12 What's New (#105278) 2023-06-04 16:42:00 +01:00
chgnrdv ce558e69d4
gh-104690 Disallow thread creation and fork at interpreter finalization (#104826)
Disallow thread creation and fork at interpreter finalization.

in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-04 04:06:45 +00:00
Nikita Sobolev eaff9c39aa
gh-89415: Mention new `IP_*` constants in `socket` module in the docs (#105266) 2023-06-03 08:28:29 -07:00
Irit Katriel 0dafc785ee
gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (#105190) 2023-06-02 17:01:46 +01:00
Irit Katriel ee26ca13a1
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (#105185) 2023-06-02 08:59:18 +01:00
Inada Naoki 37498fc950
gh-85275: Remove old buffer APIs (#105137)
They are now abi-only.

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-02 01:12:40 +00:00
Erlend E. Aasland 8a8ebf2e3d
GH-89886: Bump to GNU Autoconf v2.71 (#104925)
Co-authored-by: Christian Heimes <christian@python.org>
2023-06-01 23:44:25 +02:00
Victor Stinner c67121ac6b
gh-105145: Deprecate Py_GetPath() function (#105179)
Deprecate old Python initialization functions:

* PySys_ResetWarnOptions()
* Py_GetExecPrefix()
* Py_GetPath()
* Py_GetPrefix()
* Py_GetProgramFullPath()
* Py_GetProgramName()
* Py_GetPythonHome()

_tkinter.c uses sys.executable instead of Py_GetProgramName()
and uses sys.prefix instead of Py_GetPrefix().
2023-06-01 12:06:32 +00:00
Victor Stinner ec0082ca46
gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)
Remove functions in the C API:

* PyEval_AcquireLock()
* PyEval_ReleaseLock()
* PyEval_InitThreads()
* PyEval_ThreadsInitialized()

But keep these functions in the stable ABI.

Mention "make regen-limited-abi" in "make regen-all".
2023-06-01 13:41:56 +02:00
Victor Stinner 27f9491c60
gh-105107: Remove PyCFunction_Call() function (#105181)
* Keep the function in the stable ABI.
* Add unit tests on PyCFunction_Call() since it remains supported in
  the stable ABI.
2023-06-01 11:25:55 +02:00
Victor Stinner 7d07e5891d
gh-105156: Cleanup usage of old Py_UNICODE type (#105158)
* refcounts.dat:

  * Remove Py_UNICODE functions.
  * Replace Py_UNICODE argument type with wchar_t.

* _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),
  _PyUnicode_ToTitlecase() are no longer deprecated in comments.
  It's no longer needed since they now use Py_UCS4 type, rather than
  the deprecated Py_UNICODE type.
* gdb: Remove unused char_width() method.
2023-06-01 07:18:09 +00:00
Victor Stinner 424049cc11
gh-105145: Remove old functions to config Python init (#105154)
Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept in the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.
2023-06-01 09:14:02 +02:00
Victor Stinner 8ed705c083
gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)
Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API:
use wchar_t instead.

Replace Py_UNICODE with wchar_t in multiple C files.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2023-06-01 08:56:35 +02:00
Pablo Galindo Salgado 60cfc6d1ae
Clarify that error messages are better with PEP 701 (#105150)
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
2023-05-31 22:01:29 +01:00
Irit Katriel fbc9d0dbb2
gh-105111: remove deprecated macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (#105112) 2023-05-31 15:44:11 +01:00
Victor Stinner 0430e97097
gh-104773: cgi: Fix typo in What's New in Python 3.13 (#105139) 2023-05-31 14:54:07 +02:00
Victor Stinner 03ad6624c2
gh-105096: Deprecate wave getmarkers() method (#105098)
wave: Deprecate the getmark(), setmark() and getmarkers() methods of
the Wave_read and Wave_write classes. They will be removed in Python
3.15.
2023-05-31 12:09:41 +00:00
Victor Stinner 58a2e09816
gh-62948: IOBase finalizer logs close() errors (#105104) 2023-05-31 11:41:19 +00:00
Victor Stinner 85e5d03163
gh-105096: Reformat wave documentation (#105136)
Add ".. class::" markups in the wave documentation.

* Reformat also wave.py (minor PEP 8 changes).
* Remove redundant "import struct": it's already imported at top
  level.
* Remove wave.rst from .nitignore
2023-05-31 11:29:10 +00:00
Victor Stinner 579c41c102
gh-105107: Remove PyEval_CallFunction() function (#105108)
Remove 4 functions from the C API, deprecated in Python 3.9:

* PyEval_CallObjectWithKeywords()
* PyEval_CallObject()
* PyEval_CallFunction()
* PyEval_CallMethod()

Keep 3 functions in the stable ABI:

* PyEval_CallObjectWithKeywords()
* PyEval_CallFunction()
* PyEval_CallMethod()
2023-05-31 11:17:06 +00:00
Inada Naoki adccff3b3f
gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051) 2023-05-31 18:38:55 +09:00
Carl Meyer 5701799067
gh-97933: add LOAD_FAST_AND_CLEAR to 3.12 What's New bytecode section (#105126) 2023-05-30 20:19:25 -06:00
Carl Meyer 7fbac51baf
gh-87729: add LOAD_SUPER_ATTR to 3.12 What's New (#105125) 2023-05-30 20:19:04 -06:00
Barney Gale 49f90ba1ea
GH-73435: Implement recursive wildcards in `pathlib.PurePath.match()` (#101398)
`PurePath.match()` now handles the `**` wildcard as in `Path.glob()`, i.e. it matches any number of path segments.

We now compile a `re.Pattern` object for the entire pattern. This is made more difficult by `fnmatch` not treating directory separators as special when evaluating wildcards (`*`, `?`, etc), and so we arrange the path parts onto separate *lines* in a string, and ensure we don't set `re.DOTALL`.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-30 20:18:09 +00:00
Irit Katriel 4571eedca2
gh-105071: add missing versionadded directive (#105097) 2023-05-30 18:03:20 +01:00
Alex Waygood c8c1e73d95
gh-103921: Minor PEP-695 fixes to the `ast` module docs (#105093) 2023-05-30 09:19:10 -07:00
Irit Katriel b7aadb4583
gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (#105072) 2023-05-30 15:03:36 +01:00
Jakub Kuczys 39f6a0489f
GH-89455: Add missing attributes (added in 3.11) to traceback module docs (#105044) 2023-05-29 18:28:37 +00:00
Barney Gale ace676e2c2
GH-77609: Add follow_symlinks argument to `pathlib.Path.glob()` (GH-102616)
Add a keyword-only *follow_symlinks* parameter to `pathlib.Path.glob()` and`rglob()`.

When *follow_symlinks* is `None` (the default), these methods follow symlinks except when evaluating "`**`" wildcards. When set to true or false, symlinks are always or never followed, respectively.
2023-05-29 16:59:52 +01:00
Petr Viktorin 1668b41dc4
gh-97908: CAPI docs: Remove repeated struct names from member docs (GH-100054)
And add raw HTML fragments to keep old links working.
2023-05-29 13:54:14 +02:00
Steve Dower bfd20d257e
gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a Windows Dev Drive (GH-104805) 2023-05-29 10:05:32 +01:00
Jelle Zijlstra 595ffddb33
Document PEP 698 and other new typing features in What's New (#104957) 2023-05-28 12:13:19 -07:00
Hugo van Kemenade 3821b92c1f
gh-104992: [What's New in 3.12] Document unittest.TestProgram.usageExit's deprecation (#104995) 2023-05-28 02:06:31 -06:00
Hugo van Kemenade b225c08de8
gh-104992: Remove deprecated unittest.TestProgram.usageExit (#104993) 2023-05-27 21:34:14 +00:00
Zachary Ware a989b73e8e
gh-75552: Remove deprecated tkinter.tix module (GH-104902) 2023-05-27 12:34:19 -05:00
Hugo van Kemenade 7df861c23c
gh-104992: [What's New in 3.11] Document unittest.TestProgram.usageExit's deprecation (#104994)
Document unittest.TestProgram.usageExit's pending removal in 3.13
2023-05-26 19:09:47 -07:00
Raymond Hettinger 402ee5a68b
GH-101588: Deprecate pickle/copy/deepcopy support in itertools (GH-104965) 2023-05-26 15:32:53 -05:00
Jelle Zijlstra 060277d96b
gh-103921: Document PEP 695 (#104642)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-26 10:48:17 -07:00
Shaygan Hooshyari 61c1d6760f
gh-104984: remove kwargs and starargs from Call & ClassDef (#104986)
These fields are removed in 025e9ebd0a
2023-05-26 10:43:58 -06:00
Hugo van Kemenade 5ab4bc05c4
gh-104804: Remove webbrowser.MacOSX class, deprecated in Python 3.11 (#104816)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-05-26 16:54:15 +03:00
Victor Stinner e399f46a77
gh-104773: PEP 594: Remove the imghdr module (#104777)
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
* Update Sphinx from 4.5 to 6.2 in Doc/requirements.txt.
2023-05-26 13:29:45 +00:00
Jelle Zijlstra ba73473f4c
gh-104799: Move location of type_params AST fields (#104828)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-26 05:54:37 -07:00
Mark Dickinson 2cf04e455d
gh-104479: Update outdated tutorial floating-point reference (#104681) 2023-05-25 23:26:16 -07:00
Hugo van Kemenade 3f9c60f51e
gh-104886: Remove deprecated configparser.LegacyInterpolation (#104887)
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-05-26 06:06:32 +00:00
Hugo van Kemenade 10c45838e1
gh-104876: Remove deprecated turtle.RawTurtle.settiltangle (#104877)
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-05-26 07:25:52 +03:00
Tomas R fea8632ec6
gh-104786: Remove kwargs-based TypedDict creation (#104891)
Deprecated since Python 3.11.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-25 21:14:58 +01:00
Gregory P. Smith d08679212d
gh-104372: Drop the GIL around the vfork() call. (#104782)
On Linux where the `subprocess` module can use the `vfork` syscall for
faster spawning, prevent the parent process from blocking other threads
by dropping the GIL while it waits for the vfork'ed child process `exec`
outcome.  This prevents spawning a binary from a slow filesystem from
blocking the rest of the application.

Fixes #104372.
2023-05-25 20:14:09 +00:00
Victor Stinner 77d7ec5aa9
gh-104773: PEP 594: Remove the chunk module (#104868)
The module had no tests.
2023-05-25 16:27:55 +00:00
Victor Stinner f66be6b11a
gh-104773: PEP 594: Remove the audioop module (#104937) 2023-05-25 17:59:00 +02:00
Victor Stinner 036da3bd43
gh-104773: PEP 594: Remove the aifc module (#104933)
* Remove .aifc and .aiff test files of Lib/test/audiodata/
* Remove Lib/test/Sine-1000Hz-300ms.aif test file
2023-05-25 17:20:48 +02:00
Victor Stinner dbc8216f4c
gh-104773: PEP 594: Remove the uu module (#104932)
Doc/license.rst: Keep the UUencode and UUdecode license since it's
also used by the uu codec.
2023-05-25 16:25:27 +02:00
Victor Stinner e4127eaa1e
gh-104773: PEP 594: Remove the crypt module (#104908)
Remove the crypt module and its private _crypt extension, deprecated
in Python 3.11.
2023-05-25 15:45:46 +02:00
Alex Waygood 38539ef126
Fix indentation in `json.AttrDict` REPL example (#104930)
This is causing the docs to be rendered incorrectly.
2023-05-25 14:05:43 +01:00
Raymond Hettinger 278030a17d
Misc improvements to the itertools docs (GH-104916) 2023-05-24 22:31:02 -05:00
Raymond Hettinger 8557a97078
Misc updates to Whatsnew 3.12 (#104912) 2023-05-24 20:59:51 -05:00
Zachary Ware 98c4333e88
gh-104773: Remove the msilib package (GH-104911) 2023-05-24 20:06:00 -05:00
Jelle Zijlstra 41768a2bd3
gh-104874: Document NewType.__supertype__ (#104875) 2023-05-25 00:23:28 +01:00
Victor Stinner 087c1a6539
gh-104773: PEP 594: Remove the xdrlib module (#104900)
pickle documentation no longer mentions the XDR format.
2023-05-25 00:40:30 +02:00
Victor Stinner 17e1fe0f9b
gh-104773: PEP 594: Remove the nis module (#104897) 2023-05-25 00:08:36 +02:00
Hugo van Kemenade b1cb30ec86
gh-104835: Remove unittest's deprecated getTestCaseNames, makeSuite, findTestCases (#104836) 2023-05-24 21:16:43 +00:00
Victor Stinner ded5f1f287
gh-104773: PEP 594: Remove the nntplib module (#104894)
* socket_helper.transient_internet() no longer imports nntplib to
  catch nntplib.NNTPTemporaryError.
* ssltests.py no longer runs test_nntplib.
* "make quicktest" no longer runs test_nntplib.
* WASM: remove nntplib from OMIT_NETWORKING_FILES.
* Remove mentions to nntplib in the email documentation.
2023-05-24 21:15:43 +00:00
Victor Stinner 684e99d01d
gh-104773: PEP 594: Remove the spwd module (#104871)
Remove spwd from the configure script and Modules/Setup.
2023-05-24 20:34:41 +00:00
Victor Stinner 9d457e1154
gh-104773: PEP 594: Remove the mailcap module (#104867)
Remove Lib/test/mailcap.txt test file.
2023-05-24 14:16:55 +00:00
Hugo van Kemenade c3204ed727
RtD docs previews: Cancel building PRs if no changes in Doc dir (#104100)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-24 16:54:15 +03:00
Victor Stinner a5e0f5b230
gh-104773: PEP 594: Remove the sunau module (#104863)
* Remove Lib/test/audiodata/pluck-*.au files.
* Remove Lib/test/audiotest.au file.
2023-05-24 13:51:59 +00:00
Lysandros Nikolaou 8e5b3b90c8
gh-102856: Update "Formatted string literals" docs section after PEP701 (#104861) 2023-05-24 15:38:37 +02:00
Victor Stinner fc07fe4e37
gh-104773: PEP 594: Remove the ossaudiodev module (#104862)
* Remove ossaudiodev extension in configure.ac and regenerate
  the configure script.
* Remove ossaudiodev in Modules/Setup and Modules/Setup.stdlib.in.
2023-05-24 15:00:51 +02:00
Victor Stinner a4b7e9d1f8
gh-104773: PEP 594: Remove the pipes module (#104848) 2023-05-24 13:11:29 +02:00
Hugo van Kemenade 3e97c00171
gh-102856: Add missing quote to fix doctest (#104852) 2023-05-24 13:21:15 +03:00
Marta Gómez Macías c45701e9ef
gh-102856: Add changes related to PEP 701 in 3.12 What's New docs (#104824)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 10:36:50 +01:00
Victor Stinner 7b00940f69
gh-104773: PEP 594: Remove the sndhdr module (#104774)
Remove the Lib/test/sndhdrdata/ directory.
2023-05-24 09:32:18 +00:00
Victor Stinner 08d5923896
gh-104773: PEP 594: Remove cgi and cgitb modules (#104775)
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
2023-05-24 09:04:53 +00:00
Barney Gale 6b1510cf11
GH-83863: Drop support for using `pathlib.Path` objects as context managers (GH-104807)
In Python 3.8 and prior, `pathlib.Path.__exit__()` marked a path as closed;
some subsequent attempts to perform I/O would raise an IOError. This
functionality was never documented, and had the effect of making `Path`
objects mutable, contrary to PEP 428. In Python 3.9 we made `__exit__()` a
no-op, and in 3.11 `__enter__()` began raising deprecation warnings. Here
we remove both methods.
2023-05-23 22:31:59 +00:00
Nicolas Tessore d56c933992
gh-104770: Let generator.close() return value (#104771)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-05-23 13:51:56 -07:00
Robert O'Shea 50fce89d12
gh-102120: [TarFile] Add an iter function that doesn't cache (GH-102128) 2023-05-23 13:44:40 -07:00
Victor Stinner ae00b810d1
gh-104780: Remove 2to3 program and lib2to3 module (#104781)
* Remove the Tools/scripts/2to3 script.
* Remove the Lib/test/test_lib2to3/ directory.
* Doc/tools/extensions/pyspecific.py: remove the "2to3fixer" object
  type.
* Makefile and PC/layout/main.py no longer compile lib2to3 grammar
  files.
* Update Makefile for 2to3 removal.
2023-05-23 19:40:02 +02:00
Sebastian Rittau abdda5b133
gh-92871: Remove typing.{io,re} namespaces (#92873)
Closes #92871

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-23 13:44:26 +00:00
Victor Stinner 9dc476be2d
gh-104773: PEP 594: Remove the telnetlib module (#104778) 2023-05-23 07:09:02 +00:00
Ned Deily 42974c46bc
Fix whatsnew for 3.13. (GH-104756) 2023-05-22 16:05:27 -04:00
Brandt Bucher 357bed0bcd
GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104674) 2023-05-22 19:34:34 +00:00
Thomas Wouters 2c4e29e322 Merge branch 'main' of https://github.com/python/cpython into main 2023-05-22 21:17:26 +02:00