Victor Stinner
507896d97d
gh-116936: Add PyType_GetModuleByDef() to the limited C API ( #116937 )
2024-03-25 16:32:20 +00:00
Serhiy Storchaka
0c1a42cf9c
gh-87193: Support bytes objects with refcount > 1 in _PyBytes_Resize() (GH-117160)
...
Create a new bytes object and destroy the old one if it has refcount > 1.
2024-03-25 16:32:11 +01:00
Raymond Hettinger
9db2a8f914
Minor markup and grammar fixes in the statistics docs (gh-117216)
2024-03-25 09:26:42 -05:00
Terry Jan Reedy
78a651fd7f
gh-117194: Properly format 'base64' header in What's New ( #117198 )
...
It needs 6, not 3, '-'s.
2024-03-24 11:38:34 -04:00
Kerim Kabirov
f267d5bf2a
GH-115986 Docs: promote pprint.pp usage as a default ( #116614 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-24 07:59:14 -06:00
LilKS
39df773217
gh-101760: Improve the imaplib.IMAP4 example ( #101764 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-03-24 04:01:07 -06:00
Raymond Hettinger
a1e948edba
Add cumulative option for the new statistics.kde() function. ( #117033 )
2024-03-24 04:35:58 -05:00
Barney Gale
72eea512b8
GH-106747: Document another difference between `glob` and `pathlib`. ( #116518 )
...
Document that `path.glob()` might return *path*, whereas
`glob.glob(root_dir=path)` will never return an empty string corresponding
to *path*.
2024-03-22 19:14:09 +00:00
Serhiy Storchaka
e2e0b4b4b9
gh-113024: C API: Add PyObject_GenericHash() function (GH-113025)
2024-03-22 20:19:10 +02:00
Vinay Sajip
00baaa21de
[docs] Fix typo in docstring and add example to logging cookbook. (GH-117157)
2024-03-22 17:25:51 +00:00
Jakub Stasiak
40d75c2b7f
GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)
...
* GH-113171: Fix "private" (really non-global) IP address ranges
The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).
This patch updates the ranges with what was missing or otherwise
incorrect.
I left 100.64.0.0/10 alone, for now, as it's been made special in [1]
and I'm not sure if we want to undo that as I don't quite understand the
motivation behind it.
The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.
[1] https://github.com/python/cpython/issues/61602
2024-03-22 17:49:56 +01:00
Ned Batchelder
0907871d43
docs: fix over-linking in dataclasses.rst ( #117005 )
2024-03-21 12:47:09 -07:00
Victor Stinner
abdd1f938f
gh-85283: Build _testconsole extension with limited C API ( #117125 )
2024-03-21 17:45:43 +01:00
Victor Stinner
8bea6c411d
gh-115754: Add Py_GetConstant() function ( #116883 )
...
Add Py_GetConstant() and Py_GetConstantBorrowed() functions.
In the limited C API version 3.13, getting Py_None, Py_False,
Py_True, Py_Ellipsis and Py_NotImplemented singletons is now
implemented as function calls at the stable ABI level to hide
implementation details. Getting these constants still return borrowed
references.
Add _testlimitedcapi/object.c and test_capi/test_object.py to test
Py_GetConstant() and Py_GetConstantBorrowed() functions.
2024-03-21 16:07:00 +00:00
Malcolm Smith
1f8b24ef69
gh-71052: Implement `ctypes.util.find_library` on Android (GH-116379)
2024-03-21 14:20:57 +01:00
Carol Willing
7d446548ef
Fix sort order for "locale encoding" glossary item ( #115794 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-03-20 15:00:59 -06:00
Russell Keith-Magee
44fbab43d8
gh-117058: Update GUI and packaging recommendations for macOS. ( #117059 )
2024-03-20 17:32:56 +02:00
Mark Shannon
15309329b6
GH-108362: Incremental Cycle GC (GH-116206)
2024-03-20 08:54:42 +00:00
Ned Batchelder
332ac46c09
docs: announce venv creation before installing packages ( #117036 )
2024-03-19 21:55:20 +02:00
Hugo van Kemenade
9080e9ed50
gh-101100: Fix Sphinx warnings in `library/pydoc.rst` ( #116913 )
2024-03-19 21:48:08 +02:00
Terry Jan Reedy
025ef7a5f7
gh-56374: Clarify documentation of nonlocal ( #116942 )
...
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc. Add "Programmer's note".
2024-03-19 13:55:21 -04:00
Sunghyun Kim
7f64ae30dd
gh-107607: Update comment about utf-8 BOM being ignored ( #107858 )
...
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-19 11:51:12 -04:00
Russell Keith-Magee
408e127159
gh-114099 - Add iOS framework loading machinery. (GH-116454)
...
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-03-19 08:36:19 -04:00
Bogdan Romanyuk
a8e93d3dca
gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781)
2024-03-19 09:20:38 +00:00
Pierre Ossman (ThinLinc team)
4159644177
gh-113538: Add asycio.Server.{close,abort}_clients (redo) ( #116784 )
...
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
This is a do-over with a test fix for gh-114432, which was reverted.
2024-03-18 13:15:53 -07:00
Victor Stinner
1d95451be1
gh-63207: Use GetSystemTimePreciseAsFileTime() in time.time() ( #116822 )
2024-03-18 17:13:01 +01:00
Victor Stinner
f6cdc6b4a1
Revert "gh-96844: Improve error message of list.remove (gh-106455)" ( #116956 )
...
This reverts commit 217f47d6e5
.
2024-03-18 13:54:45 +00:00
Jakub Stasiak
2a4cbf17af
GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)
...
* GH-65056: Improve the IP address' is_global/is_private documentation
It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-18 13:57:00 +01:00
Terry Jan Reedy
4e45c6c54a
gh-116881: Remove erroneous or redundant grammar NULL (GH-116885)
...
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'. In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>. Remove it there.
2024-03-18 10:31:13 +01:00
Victor Stinner
2982bdb936
gh-85283: Build _statistics extension with the limited C API ( #116927 )
...
Argument Clinic now inlines _PyArg_CheckPositional() for the limited
C API. The generated code should be as fast or even a little bit
faster.
2024-03-17 18:59:02 +01:00
Barney Gale
0634201f53
GH-116377: Stop raising `ValueError` from `glob.translate()`. ( #116378 )
...
Stop raising `ValueError` from `glob.translate()` when a `**` sub-string
appears in a non-recursive pattern segment. This matches `glob.glob()`
behaviour.
2024-03-17 17:09:35 +00:00
Victor Stinner
1cf0301086
gh-85283: Build termios extension with the limited C API ( #116928 )
2024-03-17 15:12:29 +00:00
Victor Stinner
8e3c953b3a
gh-73468: Add math.fma() function ( #116667 )
...
Added new math.fma() function, wrapping C99's ``fma()`` operation:
fused multiply-add function.
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2024-03-17 13:58:26 +00:00
Carol Willing
c514a975ab
Update titles and subtitles on landing page template ( #116914 )
...
* Update titles and subtitles on landing page template
* address review from gvanrossum
* Edits from hugovk review
* Change word order back. Down the road we should split license and history
2024-03-17 00:01:56 +00:00
jnchen
744c077795
gh-116851: Remove "from ctypes import *" from a ctypes example (GH-116852)
...
It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
2024-03-16 15:01:45 +02:00
Nikita Sobolev
16349868d3
gh-116782: Mention `__type_params__` in `inspect.getmembers` docs ( #116783 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-15 18:47:46 +03:00
Tian Gao
a50cf6c3d7
gh-90095: Ignore empty lines and comments in `.pdbrc` ( #116834 )
2024-03-15 09:36:04 +00:00
Victor Stinner
8fc8fbb43a
gh-85283: Build pwd extension with the limited C API ( #116841 )
...
Argument Clinic now uses the PEP 737 "%T" format to format type name
for the limited C API.
2024-03-15 08:49:58 +01:00
Raymond Hettinger
41e844a4ac
gh-116842: Improve test comment and fix a doctest (gh-116846)
2024-03-14 21:40:36 -05:00
Barney Gale
1904f0a224
GH-113838: Add "Comparison to os.path" section to pathlib docs ( #115926 )
2024-03-15 00:11:49 +00:00
Victor Stinner
7bbb9b57e6
gh-111696, PEP 737: Add %T and %N to PyUnicode_FromFormat() ( #116839 )
2024-03-14 22:23:00 +00:00
Raymond Hettinger
ab9e322ae1
Minor improvements to the itertools documentation (gh-116833)
2024-03-14 16:39:50 -05:00
Victor Stinner
c432df6d56
gh-111696, PEP 737: Add PyType_GetModuleName() function ( #116824 )
...
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-03-14 18:17:43 +00:00
Victor Stinner
19c3a2ff91
gh-111696, PEP 737: Add PyType_GetFullyQualifiedName() function ( #116815 )
...
Rewrite tests on type names in Python, they were written in C.
2024-03-14 16:19:36 +00:00
Victor Stinner
846ad5a26a
gh-88494: Use QueryPerformanceCounter() for time.monotonic() ( #116781 )
...
On Windows, time.monotonic() now uses the QueryPerformanceCounter()
clock to have a resolution better than 1 us, instead of the
gGetTickCount64() clock which has a resolution of 15.6 ms.
2024-03-14 16:42:41 +01:00
Victor Stinner
97b80af897
gh-85283: Build fcntl extension with the limited C API ( #116791 )
2024-03-14 12:01:13 +00:00
Sergey B Kirpichev
e39795f2cb
Docs: PyUnstable_Long_IsCompact() docs now mention PyLong_AsNativeBytes() ( #116634 )
2024-03-14 00:01:13 +01:00
Raymond Hettinger
5ff012a449
Better presentation order for recipes. (gh-116755)
2024-03-13 15:02:56 -05:00
Nir Friedman
7f418fb111
gh-98731: Improvements to the logging documentation (GH-101618)
...
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2024-03-13 15:58:30 +00:00
Vinay Sajip
186af3cf21
[doc]: Update cookbook recipe for Qt6. (GH-116719)
2024-03-13 13:22:47 +00:00
Serhiy Storchaka
33662d4e01
gh-90300: Fix cmdline.rst (GH-116721)
...
* Fix the description of the "-b" option.
* Add references to environment variables for "-s" and "-X dev" options.
2024-03-13 15:03:13 +02:00
Raymond Hettinger
e82f6dfae5
Modernize roundrobin() recipe and improve variable names (gh-116710)
2024-03-13 02:12:30 -05:00
Terry Jan Reedy
43986f5567
gh-111307: Update design FAQ 'switch' entry ( #115899 )
2024-03-13 01:30:39 -04:00
Mariusz Felisiak
3f1b6efee9
Docs: fix broken links ( #116651 )
2024-03-12 21:19:33 -07:00
Raymond Hettinger
93a687a373
Minor clarity improvement for the iter_index() recipe. Also add value subsequence tests. (gh-116696)
2024-03-12 21:33:42 -05:00
Tushar Sadhwani
149f7f7ae2
Add `typing.NamedTuple` in glossary section for named tuples ( #108327 )
2024-03-12 15:46:42 -07:00
Raymond Hettinger
126186674e
Beef-up tests for the itertool docs. (gh-116679)
2024-03-12 17:19:58 -05:00
Jelle Zijlstra
290330714b
gh-89547: typing.rst: Add note about change in behavior with ClassVar/Final ( #116686 )
2024-03-12 15:17:53 -07:00
Nikita Sobolev
df4784b3b7
gh-116127: PEP-705: Add `ReadOnly` support for `TypedDict` ( #116350 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-12 07:49:39 -07:00
Guido van Rossum
ba13215eb1
gh-113538: Revert "gh-113538: Add asycio.Server.{close,abort}_clients ( #114432 )" ( #116632 )
...
Revert "gh-113538: Add asycio.Server.{close,abort}_clients (#114432 )"
Reason: The new test doesn't always pass:
https://github.com/python/cpython/pull/116423#issuecomment-1989425489
This reverts commit 1d0d49a7e8
.
2024-03-12 00:31:49 +00:00
Terry Jan Reedy
3e45030076
gh-116563: Update tutorial error example ( #116569 )
...
There now may be multiple carets pointing at a token
rather than just a character. Fix the sentence about
possible causes.
2024-03-11 18:01:08 -04:00
Pierre Ossman (ThinLinc team)
1d0d49a7e8
gh-113538: Add asycio.Server.{close,abort}_clients ( #114432 )
...
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
2024-03-11 12:43:30 -07:00
Malcolm Smith
872c0714fc
gh-71052: Change Android's `sys.platform` from "linux" to "android"
...
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-11 19:25:39 +00:00
Brett Simmers
2731913dd5
gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` ( #116338 )
...
In free-threaded builds, running with `PYTHON_GIL=0` will now disable the
GIL. Follow-up issues track work to re-enable the GIL when loading an
incompatible extension, and to disable the GIL by default.
In order to support re-enabling the GIL at runtime, all GIL-related data
structures are initialized as usual, and disabling the GIL simply sets a flag
that causes `take_gil()` and `drop_gil()` to return early.
2024-03-11 11:02:58 -04:00
Declan
db8f423f58
gh-116535: Fix distracting "TypeError" in example code (gh-116538)
2024-03-09 16:52:57 -05:00
Sergey B Kirpichev
1e68c4b876
gh-111389: expose PyHASH_INF/BITS/MODULUS/IMAG macros as public ( #111418 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-09 21:32:05 +01:00
Kerim Kabirov
03f86b1b62
GH-116218 Docs: Add availability information for the 'resource' module ( #116256 )
...
Add availability data to 'resource' module Docs
2024-03-09 10:00:37 +01:00
Nicolas A. Oyarzabal
601f3a7b33
gh-105535 Document potential performance trap during enum creation (GH-107119)
...
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-08 11:22:17 -08:00
infohash
735fc2cbbc
gh-75988: Fix issues with autospec ignoring wrapped object ( #115223 )
...
* set default return value of functional types as _mock_return_value
* added test of wrapping child attributes
* added backward compatibility with explicit return
* added docs on the order of precedence
* added test to check default return_value
2024-03-08 19:14:32 +00:00
Nikita Sobolev
0b647141d5
gh-116349: Deprecate `platform.java_ver` function ( #116471 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-08 11:14:17 +03:00
Skip Montanaro
d9ccde28c4
gh-106259: Add minimal help target to Makefile ( #106260 )
...
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-07 18:21:28 +01:00
Serhiy Storchaka
808a77612f
gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298)
2024-03-07 10:05:03 +02:00
William Woodruff
0876b921b2
gh-107361: strengthen default SSL context flags ( #112389 )
...
This adds `VERIFY_X509_STRICT` to make the default
SSL context perform stricter (per RFC 5280) validation, as well
as `VERIFY_X509_PARTIAL_CHAIN` to enforce more standards-compliant
path-building behavior.
As part of this changeset, I had to tweak `make_ssl_certs.py`
slightly to emit 5280-conforming CA certs. This changeset includes
the regenerated certificates after that change.
Signed-off-by: William Woodruff <william@yossarian.net>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-06 13:44:58 -08:00
Jason Zhang
ce0ae1d784
gh-115957: Close coroutine if TaskGroup.create_task() raises an error ( #116009 )
2024-03-06 12:20:26 -08:00
Sebastian Pipping
73807eb634
gh-115398: Suggest use of `hasattr` with checking for 3.13 Expat API availability (GH-116278)
...
Suggest use of "hasattr" with checking for 3.13 Expat API availability
2024-03-06 11:08:25 -08:00
Prince Roshan
e800265aa1
gh-107625: configparser: Raise error if a missing value is continued (GH-107651)
...
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-06 14:05:54 +00:00
Kerim Kabirov
e205c5cd8f
gh-115986: Fix inaccuracies in pprint docs ( #116104 )
...
Amend wording after gh-116019 was merged.
2024-03-05 22:14:52 +01:00
cui fliter
e7ba6e9dbe
chore: fix typos ( #116345 )
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 09:05:52 -07:00
Serhiy Storchaka
df59401108
Fix the PyGetSetDef documentation (GH-116056)
...
closure is not a function pointer, it is a user data pointer.
2024-03-05 17:48:20 +02:00
Serhiy Storchaka
0064dfa091
gh-115777: Fix double versionadded directives (GH-116269)
2024-03-05 17:41:53 +02:00
Tobias Rautenkranz
60743a9a7e
gh-57141: Add dircmp shallow option (GH-109499)
...
Co-authored-by: Steve Ward <planet36@gmail.com>
Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
2024-03-04 17:27:43 +00:00
Raymond Hettinger
15dc2979bc
Consistently spell out *predicate* instead of *pred*. (gh-116308)
2024-03-04 15:51:29 +00:00
pan324
0dfa7ce346
gh-115256: Remove refcycles from tarfile writing (GH-115257)
2024-03-04 13:26:32 +00:00
Kerim Kabirov
45a92436c5
GH-116271 Docs: provide clarification for object assignments in the Tutorial section ( #116283 )
...
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-04 12:22:13 +00:00
Iman Tabrizian
3383d6afa3
gh-116010: Remove link to deprecated PEP 6 in FAQ guide ( #116246 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-03 12:50:18 -07:00
HarryLHW
4859ecb860
gh-116281: Remove wrong '\' from '\*' in some doc signatures ( #116282 )
2024-03-03 14:32:32 -05:00
Hugo van Kemenade
4d3ee77aef
Docs: update using/configure.rst ( #116274 )
2024-03-03 08:40:02 -07:00
Gouvernathor
67f742e03a
gh-72971: Clarify the special no-TypeError behavior for equality ( #110729 )
2024-03-03 00:45:48 +00:00
AN Long
dac8ff4c40
gh-104711: Add security warning to the CGIHTTPRequestHandler document (GH-115915)
2024-03-01 17:25:14 +00:00
Serhiy Storchaka
05b04903a1
gh-116035: Document that both tzinfo and fold are ignored in comparisons if tzinfo is the same (GH-116187)
...
This mostly restores information removed in c12240ed28
(GH-114749).
2024-03-01 19:16:29 +02:00
Gouvernathor
2713c2abc8
gh-104219: Document that idunders can return NotImplemented ( #104220 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-01 16:51:47 +01:00
Sebastian Pipping
6a95676bb5
gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623)
...
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`
Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .
### Notes
- Please treat as a security fix related to CVE-2023-52425.
Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
2024-02-29 14:52:50 -08:00
Shantanu
c04a981ff4
Fix rendering of null character in ast.rst ( #116080 )
2024-02-29 14:09:06 -08:00
Carl Bordum Hansen
91c3c64237
gh-73580: Docs for tunnelling TLS through TLS (GH-22539)
2024-02-29 22:56:04 +02:00
Erlend E. Aasland
dbe44f150c
Docs: mark up NotImplemented using the :data: role throughout the docs ( #116135 )
2024-02-29 20:46:12 +00:00
Vinay Sajip
3b6f4cadf1
gh-115811: Update documentation to add some Logger attributes. (GH-116109)
2024-02-29 10:53:19 -08:00
Raymond Hettinger
a81d9509ee
Make the iter_except() recipe more compact. (gh-116132)
...
Only one example is needed
2024-02-29 11:30:18 -06:00
Shantanu
bea2795be2
gh-115881: Document feature_version limitations ( #115980 )
2024-02-29 11:09:09 +00:00
Erlend E. Aasland
fb2e17b642
gh-115937: Remove implementation details from inspect.signature() docs ( #116086 )
...
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-29 09:42:28 +00:00
Ethan Furman
3ea78fd5bc
gh-115821: [Enum] better error message for calling super().__new__() (GH-116063)
...
docs now state to not call super().__new__
if super().__new__ is called, a better error message is now used
2024-02-28 15:17:49 -08:00