Commit graph

27243 commits

Author SHA1 Message Date
wim glenn 9bf350b066
gh-107755: Document the correct default value of slice step (GH-107756)
Document the correct default value of slice step.
2023-09-05 21:22:27 +02:00
Nikita Sobolev ad1d6a1c20
gh-108903: Remove unneeded lambdas from asyncio (GH-108904) 2023-09-05 18:11:12 +03:00
Mark Shannon 8b515f60ee
GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772) 2023-09-05 12:35:52 +01:00
Tian Gao 6304d983a0
gh-108463: Make expressions/statements work as expected in pdb (#108464) 2023-09-04 21:44:40 +00:00
Hugo van Kemenade 7855d325e6
Link to PEP sections in What's New in 3.12 (#108878) 2023-09-04 15:02:25 -06:00
Victor Stinner 03c4080c71
gh-108765: Python.h no longer includes <ctype.h> (#108831)
Remove <ctype.h> in C files which don't use it; only sre.c and
_decimal.c still use it.

Remove _PY_PORT_CTYPE_UTF8_ISSUE code from pyport.h:

* Code added by commit b5047fd019
  in 2004 for MacOSX and FreeBSD.
* Test removed by commit 52ddaefb6b
  in 2007, since Python str type now uses locale independent
  functions like Py_ISALPHA() and Py_TOLOWER() and the Unicode
  database.

Modules/_sre/sre.c replaces _PY_PORT_CTYPE_UTF8_ISSUE with new
functions: sre_isalnum(), sre_tolower(), sre_toupper().

Remove unused includes:

* _localemodule.c: remove <stdio.h>.
* getargs.c: remove <float.h>.
* dynload_win.c: remove <direct.h>, it no longer calls _getcwd()
  since commit fb1f68ed7c (in 2001).
2023-09-03 18:54:27 +02:00
Raymond Hettinger f373c6b948
gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
gh-107208: iter_index now supports "stop" and no longer swallows ValueError
2023-09-02 22:25:13 -05:00
Victor Stinner e7de0c5901
gh-108765: Python.h no longer includes <sys/time.h> (#108775)
Python.h no longer includes <time.h>, <sys/select.h> and <sys/time.h>
standard header files.

* Add <time.h> include to xxsubtype.c.
* Add <sys/time.h> include to posixmodule.c and semaphore.c.
* readline.c includes <sys/select.h> instead of <sys/time.h>.
* resource.c no longer includes <time.h> and <sys/time.h>.
2023-09-02 17:51:19 +02:00
Victor Stinner 594b00057e
gh-108765: Python.h no longer includes <unistd.h> (#108783) 2023-09-02 16:50:18 +02:00
Victor Stinner 4f9b706c6f
gh-108794: doctest counts skipped tests (#108795)
* Add 'skipped' attribute to TestResults.
* Add 'skips' attribute to DocTestRunner.
* Rename private DocTestRunner._name2ft attribute
  to DocTestRunner._stats.
* Use f-string for string formatting.
* Add some tests.
* Document DocTestRunner attributes and its API for statistics.
* Document TestResults class.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-02 16:42:07 +02:00
Victor Stinner 4ba18099b7
gh-108765: Python.h no longer includes <ieeefp.h> (#108781)
Remove also the HAVE_IEEEFP_H macro: remove ieeefp.h from the
AC_CHECK_HEADERS() check of configure.ac.
2023-09-02 15:48:32 +02:00
Nikita Sobolev 5141b1ebe0
gh-101100: Fix sphinx warnings in unittest.mock-examples.rst (#108810) 2023-09-02 13:05:44 +01:00
Nikita Sobolev dd05c2054f
Fix typo in uuid.rst (#108809) 2023-09-02 10:08:46 +00:00
Nikita Sobolev 21da4980f5
gh-101100: Fix sphinx warnings in uuid.rst (#108805)
* gh-101100: Fix sphinx warnings in `uuid.rst`

* Use anchors
2023-09-02 09:32:19 +00:00
TATHAGATA ROY 8f9ea43ee8
gh-105563: reference DateType in datetime's documentation (#105946) 2023-09-01 13:36:24 -07:00
Serhiy Storchaka 6f97eeec22
Improve some C API documentation (GH-108768)
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes.
2023-09-01 22:21:39 +03:00
Nikita Sobolev 3047f09490
gh-101100: Fix sphinx warnings in tutorial/appendix.rst (#108750)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-01 10:57:34 +00:00
Nikita Sobolev e775601ef1
gh-101100: Fix sphinx warnings in tutorial/classes.rst (#108746) 2023-09-01 13:44:43 +03:00
Alex Povel c1e2f3b2f7
ast docs: Fix incorrect link on keyword (#108728)
In two places, Sphinx was erroneously adding links to the `keyword` module instead of the `ast.keyword` class
2023-08-31 23:17:32 +01:00
Victor Stinner 2bd960b579
gh-108337: Add pyatomic.h header (#108701)
This adds a new header that provides atomic operations on common data
types. The intention is that this will be exposed through Python.h,
although that is not the case yet. The only immediate use is in
the test file.

Co-authored-by: Sam Gross <colesbury@gmail.com>
2023-08-31 21:41:18 +00:00
Ethan Furman d48760b2f1
gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704)
When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
2023-08-31 12:45:12 -07:00
Victor Stinner 13a00078b8
gh-108634: Py_TRACE_REFS uses a hash table (#108663)
Python built with "configure --with-trace-refs" (tracing references)
is now ABI compatible with Python release build and debug build.
Moreover, it now also supports the Limited API.

Change Py_TRACE_REFS build:

* Remove _PyObject_EXTRA_INIT macro.
* The PyObject structure no longer has two extra members (_ob_prev
  and _ob_next).
* Use a hash table (_Py_hashtable_t) to trace references (all
  objects): PyInterpreterState.object_state.refchain.
* Py_TRACE_REFS build is now ABI compatible with release build and
  debug build.
* Limited C API extensions can now be built with Py_TRACE_REFS:
  xxlimited, xxlimited_35, _testclinic_limited.
* No longer rename PyModule_Create2() and PyModule_FromDefAndSpec2()
  functions to PyModule_Create2TraceRefs() and
  PyModule_FromDefAndSpec2TraceRefs().
* _Py_PrintReferenceAddresses() is now called before
  finalize_interp_delete() which deletes the refchain hash table.
* test_tracemalloc find_trace() now also filters by size to ignore
  the memory allocated by _PyRefchain_Trace().

Test changes for Py_TRACE_REFS:

* Add test.support.Py_TRACE_REFS constant.
* Add test_sys.test_getobjects() to test sys.getobjects() function.
* test_exceptions skips test_recursion_normalizing_with_no_memory()
  and test_memory_error_in_PyErr_PrintEx() if Python is built with
  Py_TRACE_REFS.
* test_repl skips test_no_memory().
* test_capi skisp test_set_nomemory().
2023-08-31 18:33:34 +02:00
Alex Waygood 013a99a47b
gh-97850: Note in py312 whatsnew that importlib.util.set_loader and importlib.util.module_for_loader have been removed (#108719)
Note in py312 whatsnew that `importlib.util.set_loader` and `importlib.util.module_for_loader` have been removed
2023-08-31 15:35:23 +01:00
Nikita Sobolev 991e4e76b5
gh-101100: Fix sphinx warnings in threading.rst (#108684)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-31 10:28:27 +03:00
Victor Stinner 2928e5dc65
gh-108494: Argument Clinic: Document how to generate code that uses the limited C API (#108584)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-08-30 16:02:48 +02:00
Victor Stinner e012cf771b
Document Python build requirements (#108646)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-30 15:28:58 +02:00
Hugo van Kemenade c7cef54631
gh-101100: Fix Sphinx warnings in the Logging Cookbook (#108678) 2023-08-30 14:37:45 +03:00
kato8966 38ab0dba80
Fix typo in multiprocessing docs (#108666) 2023-08-30 12:05:29 +01:00
Sebastian Rittau 6c484c39be
gh-108669: unittest: Fix documentation for TestResult.collectedDurations (#108670) 2023-08-30 09:36:59 +00:00
sterliakov 14ec0bb7c3
Mention Ellipsis pickling in the docs (#103660) 2023-08-30 01:11:31 +00:00
Erlend E. Aasland 0b0c1d046c
gh-108278: Deprecate passing the first param of sqlite3.Connection callback APIs by keyword (#108632)
Deprecate passing the callback callable by keyword for the following
sqlite3.Connection APIs:

- set_authorizer(authorizer_callback)
- set_progress_handler(progress_handler, ...)
- set_trace_callback(trace_callback)

The affected parameters will become positional-only in Python 3.15.
2023-08-29 22:02:12 +02:00
Erlend E. Aasland 8178a88bd8
gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268)
- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-29 19:13:38 +00:00
xzmeng 88f1c5b454
Fix misc doc typos (#108592) 2023-08-29 00:14:21 +00:00
Matthias Bussonnier f75cefd402
gh-106670: Allow Pdb to move between chained exceptions (#106676) 2023-08-28 18:31:03 +00:00
Erlend E. Aasland 4116592b6f
gh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF creation APIs (#108281)
Deprecate passing name, number of arguments, and the callable as keyword
arguments, for the following sqlite3.Connection APIs:

- create_function(name, nargs, callable, ...)
- create_aggregate(name, nargs, callable)

The affected parameters will become positional-only in Python 3.15.
2023-08-28 13:32:07 +00:00
Erlend E. Aasland 8db451ceb1
gh-64662: Fix NEWS entry and remove What's New entry (#108565) 2023-08-28 12:02:26 +00:00
nikkie 72b615ab01
Fix typo in typing docs: Remove redundant backtick (#108559) 2023-08-28 11:19:29 +00:00
Adam Turner 5d936b6479
GH-108202: Combine documentation of `calendar` constants (#108492) 2023-08-27 23:19:31 -06:00
Erlend E. Aasland d0160c7c22
gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)
Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2023-08-28 00:18:32 +02:00
Erlend E. Aasland 38afa4af9b
gh-107801: Document io.TextIOWrapper.tell (#108265) 2023-08-27 20:35:27 +00:00
Raymond Hettinger 042aa88bcc
gh-108322: Optimize statistics.NormalDist.samples() (gh-108324) 2023-08-27 08:59:40 -05:00
Matthew James Kraai cd0a8aece9
Fix grammatical error in stringprep documentation (#108414)
Remove the word "them", which didn't make grammatical sense.

Co-authored-by: KRAAI, MATTHEW [VISUS] <mkraai@its.jnj.com>
2023-08-27 11:26:23 +00:00
R 7096a2be33
gh-105052:update timeit function's description (#105060)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-08-27 03:22:27 -04:00
qqwqqw689 1ac64237e6
gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (#107486)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-27 05:19:49 +00:00
denballakh e407cea193
gh-107406: Add better struct.Struct repr (#107407) 2023-08-26 15:24:16 +05:30
Philipp A 6895ddf6cb
gh-102211: Document re.{Pattern,Match}’s existence (#102212)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-25 10:53:11 -06:00
Erlend E. Aasland cb1184280b
Docs: Resolve Sphinx warnings in dis.rst (#108476)
- Link to the code objects reference
- Suppress link to deliberately undocumented builtins.__build_class__
- Suppress links for example methods
2023-08-25 13:28:47 +02:00
Adam Turner 2b7bff0655
Datamodel: Add headings to the standard type hierarchy (#108146)
Dedent content according to the new layout.
2023-08-25 13:02:36 +02:00
Adam Turner 7f5b1a0661
Docs: Datamodel: Merge "Notes on using __slots__" with the parent section (#108400) 2023-08-25 12:27:36 +02:00
Corvin 24aa249a66
gh-107932: Fix dis module for bytecode that does not have an associated source line (GH-107988) 2023-08-25 09:31:26 +01:00
Peeyush Aggarwal 8d4052075e
gh-103384: Generalize the regex pattern BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys. (GH-103391)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-25 09:15:26 +01:00
Adam Turner 135098743a
GH-108202: Document `calendar` exceptions (#108398) 2023-08-24 23:56:54 -06:00
Victor Stinner be436e08b8
gh-108444: Add PyLong_AsInt() public function (#108445)
* Rename _PyLong_AsInt() to PyLong_AsInt().
* Add documentation.
* Add test.
* For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
2023-08-24 23:55:30 +02:00
A 7f31676340
Fix a code snippet typo in asyncio docs (#108427) 2023-08-24 16:27:54 +00:00
Victor Stinner 6726626646
gh-108314: Add PyDict_ContainsString() function (#108323) 2023-08-24 15:59:12 +02:00
Daniele Procida 809ea7c4b6
gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434)
https://docs.python.org/3/howto/pyporting.html#porting-python-2-code-to-python-3 was written for another time. In this patch:

- material that frames Python 3 as "new" is removed
- descriptions and directions have been trimmed
2023-08-24 11:28:23 +02:00
Gregory P. Smith b6be18812c
gh-70766: Mention the object getstate caveat in 3.11 What's new. (#108379) 2023-08-23 15:00:09 -07:00
Serhiy Storchaka 422f81b5d2
gh-107298: Fix a few more refs in the C API docs (GH-108361)
gh-107298: Fix few more refs in the C API docs
2023-08-23 20:12:42 +03:00
Petr Viktorin 31b61d19ab
gh-108294: Add time.sleep audit event (GH-108298) 2023-08-23 11:00:22 +02:00
FrozenBob 79fdacc005
gh-108267: Dataclasses docs: Fix object.__setattr__ typo (#108355)
Fixed a sentence in dataclasses.rst

Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
2023-08-23 08:11:15 +01:00
Hugo van Kemenade fc23f34cc9
gh-107136: Remove Plausible for docs metrics (#107856) 2023-08-22 20:45:22 +02:00
Adam Turner e97b7bef4f
GH-92584: Remove distutils from the newtypes tutorial includes (#108024) 2023-08-22 20:42:51 +02:00
Hadházy Tamás 13966da71b
gh-105857: Document that asyncio subprocess std{in,out,err} can be file handles (#107986)
stdin/out can be filehandles -> add to docs.
2023-08-22 20:41:56 +02:00
Hugo van Kemenade 39de79b345
Document 3.13, 3.14 and future removals (#108055) 2023-08-22 20:40:46 +02:00
Hugo van Kemenade 35cb1605d0
Docs: Add link to skip to datetime's format codes (#108027) 2023-08-22 20:38:38 +02:00
Nikita Sobolev e8ef0bdd8c
gh-107700: [Enum] Document that EnumType was added in 3.11 (GH-108260) 2023-08-22 07:34:18 -07:00
Erlend E. Aasland 893215a4e7
Docs: align the param spec of sqlite3.Connection methods with the implementation (#108285)
- no parameters of create_aggregate() are positional-only
- all parameters of create_collation() are positional-only
2023-08-22 13:20:58 +00:00
Serhiy Storchaka d7202e4879
gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258) 2023-08-22 15:50:30 +03:00
Junya Fukuda c556f9a3c9
gh-106971: Docs: Add missing issue reference (#106992)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-22 15:38:01 +03:00
Erlend E. Aasland 1a1bfc2891
gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly (#108015) 2023-08-22 13:10:29 +02:00
Erlend E. Aasland 7f87ebbc3f
gh-107801: Improve the accuracy of io.TextIOWrapper.seek docs (#107933)
Clearly document the supported seek() operations:

- Rewind to the start of the stream
- Restore a previous stream position (given by tell())
- Fast-forward to the end of the stream
2023-08-22 09:37:53 +02:00
Sam Gross 4b32d4f49c
gh-108223: Document --disable-gil flag in configure (#108236) 2023-08-21 20:37:07 +00:00
Serhiy Storchaka d63972e289
gh-107298: Fix C API datetime documentation (GH-108034) 2023-08-21 21:15:46 +03:00
temach 1cc391d9e2
gh-108224: Fix asyncio doc inconsistency (#108230)
(Spawning subprocesses does not require the event loop to run in the main thread -- only signal handling does.)
2023-08-21 18:08:04 +00:00
Serhiy Storchaka db55383829
gh-107298: Fix references to deprecated and removed PyUnicode C API (GH-108077) 2023-08-21 20:05:15 +03:00
Irit Katriel 10a91d7e98
gh-108113: Make it possible to create an optimized AST (#108154) 2023-08-21 16:31:30 +00:00
David Lechner 47022a079e
docs: fix grammar in isolating-extensions.rst (#108037) 2023-08-21 15:41:34 +00:00
Petr Viktorin acbd3f9c5c
gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
2023-08-21 12:56:46 +02:00
Serhiy Storchaka 622ddc4167
Improve references in the tutorial (GH-108069)
* Use full qualified names for references (even if they do not work now,
  they will work in future).
* Silence references to examples.
2023-08-21 13:41:01 +03:00
Adam Turner 8f3d09bf5d
Resolve reference warnings in faq/gui.rst (#108147)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-21 07:37:52 +00:00
Adam Turner 6323bc33ff
Resolve reference warnings in faq/library.rst (#108149)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-20 19:01:13 +00:00
Adam Turner 92815cc7cf
Resolve reference warnings in faq/design.rst (#108148) 2023-08-20 12:34:27 -06:00
Erlend E. Aasland f904aa4e1f
Docs: document 'manager' and '_log' attrs of logging.Logging (#108145)
Authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-20 16:01:10 +00:00
Adam Turner a390ec20f5
Resolve reference warnings in faq/programming.rst (#108150) 2023-08-20 19:23:28 +05:30
Erlend E. Aasland c735e79afb
Docs: Fix Sphinx warnings in logging.rst (GH-108139)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-08-20 12:19:07 +01:00
Erlend E. Aasland 4d4393139f
Docs: Fix Sphinx warnings in license.rst (#108142)
- Fix links to stdlib modules
- Silence links to external functions
2023-08-20 13:10:48 +02:00
Erlend E. Aasland 29fa7afef9
Docs: Fix Sphinx warnings in sys.rst (#108106)
- Mark up named tuple attributes as attributes
- Remove links for external functions
- io.BufferedIOBase has no 'buffer' attribute;
  remove the link and mark up using :attr:`!buffer`
- (Re)format some tables as bullet lists:
  - sys._emscripten_info
  - sys.hash_info
  - sys.int_info
  - sys.thread_info
- In the paragraphs mentioning 'f_trace_lines' and 'f_trace_opcodes',
  add links to the frame objects reference.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-20 13:09:33 +02:00
Tomas R beffb30dc7
gh-107659: Improve wording of the description of ctypes.pointer and ctypes.POINTER (#107769)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-08-20 10:54:06 +00:00
Hadházy Tamás 1a713eac47
gh-107619: Extend functools LRU cache docs with generators and async functions (#107934)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-08-20 10:33:15 +00:00
Rafael Fontenelle 1dc0c58d2b
Fix misspellings in sysconfig docs (#108156) 2023-08-20 08:11:39 +00:00
Tin Tvrtković a47c13cae5
gh-107980: fix doc role for asyncio.timeouts (#108126) 2023-08-19 13:14:38 -07:00
Erlend E. Aasland c31c61c04e
Docs: Remove links to external C functions and macros in os.rst (#108138)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-19 17:03:26 +00:00
Serhiy Storchaka 79db9d9a0e
gh-72684: Tkinter: provide interface for "tk busy" subcommands (GH-107684)
Add tkinter.Misc methods: tk_busy_hold(), tk_busy_configure(), tk_busy_cget(),
tk_busy_forget(), tk_busy_current(), and tk_busy_status().
2023-08-19 14:48:02 +03:00
Erlend E. Aasland ca0c6c1f1e
Docs: format sys.float_info properly (#108107)
- Normalise capitalisation and punctuation
- Use attribute markup for named tuple attributes
- Use :c:macro: markup for C macros
- Use a list for the 'rounds' attribute values
- Use list-table, for better .rst readability
- Remove one unneeded sys.float_info.dig link

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-19 08:34:34 +00:00
Serhiy Storchaka 2f311437cd
gh-107704: Argument Clinic: add support for deprecating keyword use of parameters (GH-107984)
It is now possible to deprecate passing keyword arguments for
keyword-or-positional parameters with Argument Clinic, using the new
'/ [from X.Y]' syntax.
(To be read as "positional-only from Python version X.Y")

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-19 10:13:35 +03:00
C.A.M. Gerlach eb953d6e44
gh-101100: Only show GitHub check annotations on changed doc paragraphs (#108065)
* Only show GitHub check annotations on changed doc paragraphs
* Improve check-warnings script arg parsing following Hugo's suggestions
* Factor filtering warnings by modified diffs into helper function
* Build docs on unmerged branch so warning lines match & avoid deep clone

---------

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-18 19:43:28 -05:00
Erlend E. Aasland dd4442c8f5
gh-107801: Improve the accuracy of os.lseek docs (#107935)
- name the last parameter *whence*, like it is for seek() methods on
  file objects
- add param docstrings
- structure the valid *whence* params

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-18 19:53:51 +02:00
Raymond Hettinger 6db39b1460
Minor code clean-up for the factor() recipe (GH-108114) 2023-08-18 12:13:58 -05:00
Victor Stinner 3ff5ef2ad3
gh-108014: Add Py_IsFinalizing() function (#108032)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-18 12:34:41 +02:00
Erlend E. Aasland cc58ec9724
Docs: emphasise warning and add accurate markups for sys.unraisablehook (#108105) 2023-08-18 12:16:22 +02:00
Erlend E. Aasland 02079b010c
gh-107801: Improve the docs of the SEEK_* constants (#108099) 2023-08-17 20:41:35 +00:00
Erlend E. Aasland 5c76899dad
Docs: Fix Sphinx warnings in io.rst (#107903)
- Mark up parameter and argument names properly
- If possible, link to docs for methods like `seek`, `tell`, `write`, `read`, etc.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-17 19:19:01 +00:00
Nikita Sobolev 80f30cf51b
gh-102029: Deprecate passing arguments to _PyRLock in threading (#102071) 2023-08-17 09:19:07 -07:00
Erlend E. Aasland 8a19f225b9
gh-107801: Document SEEK_HOLE and SEEK_DATA (#107936)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
2023-08-17 16:14:01 +02:00
Adam Turner 33e6e3fec0
GH-107987: Remove the Distributing Python Modules guide (#108016) 2023-08-17 13:01:14 +03:00
Serhiy Storchaka f51f0466c0
gh-107298: Fix some references in the C API documentation (GH-108072) 2023-08-17 11:16:00 +03:00
Serhiy Storchaka c9d83f93d8
gh-107298: Add standard exceptions and warnings in the nitpick_ignore list (GH-108029) 2023-08-17 09:44:05 +03:00
Adam Turner e88eb3775e
GH-92584: Remove references to Distutils in configure.rst (#108043)
Remove references to Distutils in configure.rst
2023-08-16 23:13:05 +02:00
Adam Turner fbb7cbc0e9
GH-92584: Remove Installing Python Modules (Distutils version) (#108020) 2023-08-16 21:06:56 +00:00
Adam Turner 636ca313b2
GH-92584: Remove references to Distutils in `PYTHONUSERBASE` (#108040)
Remove references to Distutils in ``PYTHONUSERBASE``
2023-08-16 22:43:30 +02:00
Adam Turner 902864256c
GH-92584: Redirect macOS package installation to the PPUG (#108044) 2023-08-16 20:42:23 +00:00
Serhiy Storchaka 882cb79afa
gh-56166: Deprecate passing confusing positional arguments in re functions (#107778)
Deprecate passing optional arguments maxsplit, count and flags in
module-level functions re.split(), re.sub() and re.subn() as positional.
They should only be passed by keyword.
2023-08-16 13:35:35 -07:00
Adam Turner 57fcf96e4f
GH-92584: Remove reference to Distutils in `cx_Freeze`'s description (#108047)
Remove reference to Distutils in ``cx_Freeze``'s description
2023-08-16 22:23:12 +02:00
Victor Stinner c2941cba7a
gh-107298: Fix C API Buffer documentation (#108011) 2023-08-16 18:24:46 +02:00
Adam Turner f2a9dfdee9
GH-92584: Drop reference to Distutils in `site.USER_BASE` (#108031)
Drop reference to Distutils in ``site.USER_BASE``
2023-08-16 18:10:44 +02:00
Victor Stinner e35c722d22
gh-106659: Fix test_embed.test_forced_io_encoding() on Windows (#108010)
Use config.legacy_windows_stdio=1 to avoid _io._WindowsConsoleIO.
2023-08-16 11:56:56 +00:00
Erlend E. Aasland 13c36dc9ae
gh-93057: Deprecate positional use of optional sqlite3.connect() params (#107948) 2023-08-15 08:09:56 +00:00
Romuald Brunet a482e5bf00
gh-76913: Add "merge extras" feature to LoggerAdapter (GH-107292) 2023-08-15 08:23:54 +01:00
Vinay Sajip cc2cf85d03
gh-107877: Update logging levels reference table with usage criteria. (#107894)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-13 14:19:41 +01:00
Raymond Hettinger 2b6dc2accc
Add another example to the statistics docs (GH-107904) 2023-08-13 08:01:23 -05:00
wookie184 2e1f688fe0
gh-107891: Fix typo in 3.12 whatsnew (#107892) 2023-08-12 12:05:22 +00:00
Carl Meyer 66e4edd734
gh-91051: fix segfault when using all 8 type watchers (#107853) 2023-08-11 12:42:26 -06:00
Erlend E. Aasland 637f7ff2c6
Docs: Document PyBUF_MAX_NDIM (#107865) 2023-08-11 18:03:53 +02:00
shailshouryya 23a6db98f2
gh-107421: Clarify OrderedDict Examples and Recipes (#107613) 2023-08-10 23:43:13 -05:00
Brandt Bucher a9caf9cf90
GH-105848: Simplify the arrangement of CALL's stack (GH-107788) 2023-08-09 18:19:39 +00:00
Erlend E. Aasland 34cafd35e3
Docs: clean up Argument Clinic howto's (#107797)
- fix formatting in @text_signature howto and NEWS entry
- fix formatting and example text in deprecate-positionals howto
2023-08-09 09:43:02 +02:00
Erlend E. Aasland 0be3743f54
gh-104683: Add --exclude option to Argument Clinic CLI (#107770)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-08 20:50:54 +00:00
Raymond Hettinger aab6f7173a
GH-100425: Note improved commutativity in sum(). (GH-107785) 2023-08-08 18:30:33 +01:00
Erlend E. Aasland a9aeb99579
gh-86457: Add docs for Argument Clinic @text_signature directive (#107747)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-08 08:42:08 +02:00
Eric Snow 5dc825d504
gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)
PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts.  In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has.

This change updates the documentation to reflect that perspective.  It also updates the docs relative to immortal objects in a handful of places.
2023-08-07 15:40:59 -06:00
Erlend E. Aasland 8c9af6b9a0
Docs: Fix more Sphinx annotations in ctypes.rst (#107708) 2023-08-07 15:11:05 +02:00
Erlend E. Aasland 33cb0b06ef
gh-95065: Add Argument Clinic support for deprecating positional use of parameters (#95151)
It is now possible to deprecate passing parameters positionally with
Argument Clinic, using the new '* [from X.Y]' syntax.
(To be read as "keyword-only from Python version X.Y")

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-07 11:28:08 +00:00
Tomas R 6925c578a0
gh-107442: Document all valid types for ctypes _as_parameter_ (#107443) 2023-08-07 12:41:39 +02:00
Erlend E. Aasland a6675b1a59
Docs: Argument Clinic: Move the CConverter class to the reference (#107671) 2023-08-07 02:08:34 +02:00
Kamil Turek 4e242d1ffb
Improve cross-references in runpy docs (#107673)
- Add links to `__main__` and `sys.path` where appropriate
- Ensure each paragraph never has more than one link to the same thing, to avoid visual clutter from too many links
2023-08-06 21:11:16 +00:00
Adam Turner 9564e31cbc
Do not use deprecated `logger.warn()` in pyspecific (#107694) 2023-08-06 13:58:00 +00:00
Hugo van Kemenade 9641c4d8e2
Docs: skip python-docs-theme 2023.7 to fix mobile menu (#107666) 2023-08-06 13:08:32 +02:00
Erlend E. Aasland 71a7c96ffe
Docs: Fix Sphinx annotations in Doc/library/ctypes.rst (#107672)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-06 10:23:50 +02:00
cocoatomo ecb05e0b98
GH-84435: Make pyspecific directives translatable (#19470)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-08-05 23:10:50 -06:00
Erlend E. Aasland 4a5b4221e3
Docs: Argument Clinic: Improve 'How to write a custom converter' (#107328)
- Omit unneccesary wording and sentences
- Don't mention implementation details (no digression, explanation)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-08-05 20:19:37 +00:00
Terry Jan Reedy 9ebc6ecbc3
gh-107662: Switch 'any' and 'anext' in functions.rst (#107663)
Order was reversed in index at top, not in body.
2023-08-05 14:38:20 +00:00
Daniele Procida 5e2746d6e2
gh-107432 Fix incorrect indentation in annotations HOWTO (#107445)
gh-107432 Fix incorrect indentation in annotations document

Body text in https://docs.python.org/3/howto/annotations.html was
indented throughout, and was being rendered in blockquote elements.
2023-08-05 14:28:28 +03:00
Barney Gale ec0a0d2bd9
GH-70303: Emit FutureWarning when pathlib glob pattern ends with ** (GH-105413)
In a future Python release, patterns with this ending will match both files
and directories. Users may add a trailing slash to remove the warning.
2023-08-04 23:12:12 +00:00
Hugo van Kemenade 904b5319b3
Docs: Only include Plausible for html, not for epub etc (#107637)
Only include Plausible for html, not for epub etc
2023-08-04 21:33:34 +03:00
Tomas R 09a8cc7984
gh-107600: Docs: Update ctypes.ArgumentError error message (#107601) 2023-08-04 16:34:04 +02:00
Hugo van Kemenade 19f32b24b2
Docs: upgrade to python-docs-theme 2023.7 (#107617) 2023-08-04 14:16:10 +00:00
Mark Shannon fa45958450
GH-107263: Increase C stack limit for most functions, except _PyEval_EvalFrameDefault() (GH-107535)
* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
2023-08-04 10:10:29 +01:00
Irit Katriel dd693d6320
gh-105481: simplify definition of pseudo ops in Lib/opcode.py (#107561) 2023-08-02 18:16:57 +01:00
Alexandru Mărășteanu c8872f4285
Clarify Self interaction with subclasses (#107511) 2023-08-01 13:20:25 -07:00
Irit Katriel 6ef8f8ca88
gh-105481: the ENABLE_SPECIALIZATION flag does not need to be generated by the build script, or exposed in opcode.py (#107534) 2023-08-01 17:05:00 +00:00
Eric Snow 79e479c45f
gh-99113: Add a What's New Entry for PEP 684 (gh-107520) 2023-07-31 23:13:55 +00:00
Eric Snow db361a340a
gh-105766: Document that Custom Allocators Must Be Thread-Safe (gh-107519) 2023-07-31 23:11:15 +00:00
Eric Snow fb344e99aa
gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (#107403)
It was added in 3.12 for PEP 684 (per-interpreter GIL).
2023-07-31 17:03:01 -06:00
Erlend E. Aasland abb71c6a8f
gh-107507: Replace 'The goals of Argument Clinic' with a summary (#107508)
Summarise the goals of Argument Clinic in a single sentence.
Mention that Argument Clinic was introduced with PEP-436.
2023-07-31 23:33:13 +02:00
Jacob Walls de51dede5b
gh-106762: Add news for EnumMeta.__getattr__ removal (GH-107466) 2023-07-31 10:24:44 -07:00
Michael The a22ff8e11c
gh-105578: Document that AnyStr is deprecated in py313 (#107116)
It will not be removed until Python 3.18.
2023-07-31 15:43:53 +00:00
Michael The f877b32b87
gh-105578: Add more usage examples to typing.AnyStr docs (#107045)
``typing.AnyStr`` has different semantics to ``str | bytes``, which often leads to user confusion
2023-07-31 16:23:08 +01:00
Ned Deily 83e0976f89
gh-99079: Update macOS installer to use OpenSSL 3.0.9. (GH-107474) 2023-07-31 05:58:35 +00:00
Dong-hee Na a24e25d74b
gh-107427: Update the description of UNPACK_SEQUENCE (gh-107429) 2023-07-31 00:40:37 +09:00
da-woods f2abeb590d
Fix the documentation for PyCode_New add qualname parameter (#107186) 2023-07-29 23:11:40 +05:30
Rakesh Sabale 89fd4f4a3f
gh-107422: Remove outdated TypedDict example from typing docs (#107436) 2023-07-29 17:04:46 +00:00
Inada Naoki 37551c9cef
gh-107369: optimize textwrap.indent() (#107374) 2023-07-29 06:37:23 +00:00
Serhiy Storchaka f2d07d3289
gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) 2023-07-29 08:48:10 +03:00
Serhiy Storchaka 413ba8943e
gh-107091: Fix some uses of :func: role (GH-107378)
:c:func: or :c:macro: should be used instead.
2023-07-29 08:43:10 +03:00
Eric Snow cf63df88d3
gh-107307: Update the importlib Docs for PEP 684 (gh-107400) 2023-07-28 16:00:03 -06:00
Eric Snow c0b81c4b54
gh-107305: Update the C-API Docs for PEP 684 (gh-107324) 2023-07-28 13:46:55 -06:00
Mark Shannon 1ee605c588
GH-101291: Add warning to "what's new" that PyLongObject internals have changed. (GH-107388) 2023-07-28 17:07:33 +01:00
Serhiy Storchaka 0aa58fa7a6
gh-107091: Fix some uses of :const: role (GH-107379)
It is for references, not for literals.
2023-07-28 13:26:28 +03:00
Serhiy Storchaka 983305268e
gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) 2023-07-27 18:44:32 +03:00
Victor Stinner 9a7204b86b
gh-105268: _PyGC_FINALIZED() removal is already documented in 3.12 (#107350) 2023-07-27 14:43:09 +00:00
Alex Waygood f84d77b4e0
Bump some docs dependencies to resolve a Dependabot security alert (#107341) 2023-07-27 11:53:21 +00:00
Daniele Procida ccd4253752
gh-106996: Rewrite turtle explanation (#107244)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-27 11:02:19 +03:00
Serhiy Storchaka abec9a1b20
gh-107298: Docs: add targets for some :c:member: and :c:macro: references (GH-107316)
Add targets for PyStructSequence_Desc and PyStructSequence_Field members
and macros like Py_EQ.
Fix target for Py_RETURN_RICHCOMPARE.
2023-07-27 09:04:02 +03:00
Serhiy Storchaka d363eb5b02
gh-107091: Fix some uses of :attr: role (GH-107318)
Fix also formatting of PyMethodDef members.
2023-07-27 08:52:54 +03:00
Victor Stinner 8d61a71f9c
gh-107298: Fix more Sphinx warnings in the C API doc (#107329)
Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.

* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()

Add C standard C types to nitpick_ignore in Doc/conf.py:

* int64_t
* uint64_t
* uintptr_t

No longer ignore non existing "__int" type in nitpick_ignore.

Update Doc/tools/.nitignore
2023-07-27 00:52:40 +00:00
Victor Stinner 391e03fa05
gh-107298: Fix Sphinx warnings in the C API doc (#107302)
* Update Doc/tools/.nitignore
* Fix BufferedIOBase.write() link in buffer.rst
2023-07-27 01:41:15 +02:00
Erlend E. Aasland 2ad699002e
Docs: Argument Clinic: Restructure "Basic concepts and usage" (#106981)
Split "Basic concepts and usage" into:

- Reference
  - Terminology
  - CLI reference

- Background
  - Basic concepts

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-26 22:08:43 +00:00
Erlend E. Aasland 592395577c
Docs: Remove the numbered steps from the Argument Clinic tutorial (#107203)
Instead, order the tutorial as one body of prose, making it easier to
align the tutorial according to Diátaxis principles.
2023-07-26 22:54:25 +02:00
Serhiy Storchaka 6d5b6e71c8
gh-107091: Fix some uses of :c:type: role (GH-107138) 2023-07-26 22:29:23 +03:00
Serhiy Storchaka af61cb9c78
gh-107091: Fix some uses of :c:member: role (GH-107129) 2023-07-26 22:16:06 +03:00
Roman Yurchak 737d1da074
Document that os.link() is not available on Emscripten (GH-104822) 2023-07-26 11:38:59 -07:00
Victor Stinner 87b39028e5
gh-107298: Fix doc references to undocumented modules (#107300)
Update also Doc/tools/.nitignore.
2023-07-26 18:59:06 +02:00
Victor Stinner b1de3807b8
gh-106948: Update documentation nitpick_ignore for c:identifer domain (#107295)
Update the nitpick_ignore of the documentation configuration to fix
Sphinx warnings about standard C types when declaring functions with
the "c:function" markups.

Copy standard C types declared in the "c:type" domain to the
"c:identifier" domain, since "c:function" markup looks for types in
the "c:identifier" domain.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-26 18:04:46 +02:00
Pablo Galindo Salgado da8f87b7ea
gh-107015: Remove async_hacks from the tokenizer (#107018) 2023-07-26 16:34:15 +01:00
Gregory P. Smith 70dc009469
gh-106939: document ShareableList nul-strip quirk. (#107266)
* gh-106939: document ShareableList nul-strip quirk.
* Mention the `int` size constraint.
2023-07-25 14:09:25 -07:00
Daniele Procida 2425346fee
gh-106996: Add a how-to section to the turtle documentation (#107153)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-25 15:03:57 +03:00
Serhiy Storchaka 329e4a1a3f
gh-86493: Modernize modules initialization code (GH-106858)
Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated
PyModule_AddObject().
2023-07-25 14:34:49 +03:00
Erlend E. Aasland ff5f94b72c
Docs: Add missing markup to Argument Clinic docs (#106876)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-24 15:22:18 +00:00
da-woods 0a9b339363
Fix PyVectorcall_Function doc versionadded (#107140)
The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.
2023-07-24 14:54:38 +02:00
Hakan Celik ebe44a5155
Docs: Remove duplicate word in Argument Clinic howto heading (#107169) 2023-07-24 13:54:39 +02:00
TommyUnreal 2cf99026d6
gh-107017: Change Chapter Strings to Texts in the Introduction chapter. (#107104)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-24 05:55:57 +00:00
cLupus 7ca2d8e053
gh-105291: Add link to migration guide for distutils (#107130)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-07-23 14:50:01 -07:00
Erlend E. Aasland b447e19e72
gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (#107062)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-23 22:56:56 +02:00
Ezio Melotti 956b3de816
Remove superflous whitespaces in layout.html. (GH-107067) 2023-07-23 17:18:50 +02:00
Dong-hee Na d1b839b453
gh-107122: Update what's news for dbm.*dbm.clear() method (gh-107135) 2023-07-24 00:08:50 +09:00
Dong-hee Na 0ae4870d09
gh-107122: Add clear method to dbm.ndbm module (gh-107126) 2023-07-23 14:26:23 +00:00
Dong-hee Na b273837fea
gh-107122: Add clear method to dbm.gdbm.module (gh-107127) 2023-07-23 13:51:12 +00:00
TommyUnreal e59da0c4f2
gh-107017: Analolgy to Pascal and C replaced. (#107025)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-07-23 06:07:24 -06:00
Serhiy Storchaka 08a228da05
gh-107091: Fix the use of some C domain roles (#107092) 2023-07-23 12:27:05 +02:00
Daniele Procida a2a0e51400
gh-106996: Add the basics of a turtle graphics tutorial (#107072)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-23 03:43:27 -06:00