Commit Graph

23890 Commits

Author SHA1 Message Date
Jesús Cea 989af25616
Typo (#23482) 2020-11-24 00:56:30 +01:00
Yaroslav Pankovych 79d2e62c00
Added support for negative indexes to PurePath.parents (GH-21799)
This commit also fixes up some of the overlapping documentation changed
in bpo-35498, which added support for indexing with slices.

Fixes bpo-21041.
https://bugs.python.org/issue21041

Co-authored-by: Paul Ganssle <p.ganssle@gmail.com>
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2020-11-23 15:06:22 -05:00
Raymond Hettinger ffae93248a
Descriptor HowTo: Improve the fidelity of the member object simulation (GH-23475) 2020-11-23 10:56:59 -08:00
Nick Crews 2f2f9d0b5c
bpo-15450: Allow subclassing of dircmp (GH-23424) (#23424)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-11-23 18:29:37 +02:00
John Belmonte 5ef53a88f3
Doc: fix typo in typing.Type docs (GH-23460) 2020-11-22 23:54:19 +09:00
Serhiy Storchaka 686c203cd4
bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441) 2020-11-22 13:25:02 +02:00
Ram Rachum bd8c22e1fa
bpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)
Removing 'evaluate' makes it more consistent with other assertX entries.
2020-11-22 00:59:48 -05:00
Richard Levasseur 68f68fa423
Clarify that Set._from_iterable is not required to be a classmethod. (GH-23272) 2020-11-21 11:56:24 -08:00
David CARLIER 0e62efc51e
bpo-42232: mmap module add Darwin specific madvise options. (GH-23076) 2020-11-21 03:39:56 -08:00
Serhiy Storchaka 1db76394ea
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() (GH-23410)
* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
2020-11-21 12:02:53 +02:00
Quentin Hibon aa3a3521ce
bpo-42419: Correct 'deprecatations' is What's New 3.9 (GH-23421) 2020-11-20 23:07:22 -05:00
ArioA 6edf06b24a
bpo-42407: Use possessive appostrophe in multiprocessing doc (GH-23400) 2020-11-20 21:37:54 -05:00
Raymond Hettinger 9fc319dc03
bpo-42360: Add advice to help avoid pickling issues. (GH-23305) 2020-11-20 12:49:32 -08:00
Zhang Maiyun 4c24b08cd3
Fix wrong availability for signal.SIGCHLD (#23285)
I believe this is a mistake. SIGCHLD is only available on Unix systems, not Windows.
2020-11-20 20:16:46 +02:00
Joshua Cannon 4520584483
bpo-35498: Added slice support to PathLib parents attribute. (GH-11165)
Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.
2020-11-20 10:40:39 -05:00
Christian Heimes 03c8ddd9e9
bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-20 00:26:07 -08:00
kj e1dc0db8c7
bpo-42345: Add whatsnew and versionchanged for typing.Literal in 3.9 (GH-23386)
* Whatsnew entry in 3.9 same as the one in 3.10.
* versionchanged for typing.Literal docs

Needs backport to 3.9.
2020-11-19 09:37:26 -08:00
Yurii Karabas 1b54077ff6
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Fix hash implementation of `typing.Literal`.

Update docs regarding `typing.Litaral` caching.

Base implementation was done in PR #23294.
2020-11-19 08:17:38 -08:00
kj 4687338d0e
bpo-42345: Add whatsnew for typing.Literal in 3.10 (GH-23385) 2020-11-18 20:44:24 -08:00
Lysandros Nikolaou a85fefe71b
bpo-42381: Document walrus-related syntax changes in whatsnew (GH-23382)
Automerge-Triggered-By: GH:lysnikolaou
2020-11-18 15:49:28 -08:00
Andre Delfino 829b177436
[doc] Fix smtplib and xml.dom.minidom mark-up (GH-22769) 2020-11-18 23:45:17 +01:00
Miro Hrončok e0251787d8
bpo-39573: Remove What's new entry for Py_SIZE() (GH-23375)
A follow up for 0e2ac21dd4
2020-11-18 22:39:03 +01:00
Vladimir Matveev 7c9487ded4
bpo-42085: Add documentation for Py_TPFLAGS_HAVE_AM_SEND (GH-23374)
Updated docs to include `Py_TPFLAGS_HAVE_AM_SEND`. News section should not be necessary.

Automerge-Triggered-By: GH:asvetlov
2020-11-18 10:58:38 -08:00
Victor Stinner 0e2ac21dd4
bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)
This change partically reverts
commit ad3252bad9
and the commit fe2978b3b9.

Many third party C extension modules rely on the ability of using
Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an
object type using: "Py_SIZE(obj) = size;".
2020-11-18 18:48:06 +01:00
Tom Gringauz 9c98e8cc3e
bpo-42396: Add a whatsnew entry about async contextlib.nullcontext (GH-23357)
Automerge-Triggered-By: GH:asvetlov
2020-11-17 14:58:35 -08:00
Pablo Galindo e59958f8b6
bpo-41625: Specify that Linux >= 2.6.17 *and* glibc >= 2.5 are requir… (GH-23351)
…ed for splice()
2020-11-17 11:57:03 -08:00
Pablo Galindo fa96608513
bpo-41625: Add versionadded to os.splice() constants (GH-23340) 2020-11-17 18:13:50 +00:00
Erlend Egeberg Aasland a1f401a58b
bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163) 2020-11-17 17:55:12 +02:00
Victor Stinner 296a796951
bpo-41713: Remove PyOS_InitInterrupts() function (GH-23342)
Remove the undocumented PyOS_InitInterrupts() C function.

* Rename PyOS_InitInterrupts() to _PySignal_Init(). It now installs
  other signal handlers, not only SIGINT.
* Rename PyOS_FiniInterrupts() to _PySignal_Fini()
2020-11-17 16:22:23 +01:00
Pablo Galindo a57b3d30f6
bpo-41625: Expose the splice() system call in the os module (GH-21947) 2020-11-17 00:00:38 +00:00
Lysandros Nikolaou c26d5916d6
bpo-40939: Document removal of the old parser in 3.10 whatsnew (GH-23321)
Automerge-Triggered-By: GH:lysnikolaou
2020-11-16 10:46:37 -08:00
Victor Stinner 3df5c68487
bpo-37205: time.perf_counter() and time.monotonic() are system-wide (GH-23284)
time.perf_counter() on Windows and time.monotonic() on macOS are now
system-wide. Previously, they used an offset computed at startup to
reduce the precision loss caused by the float type. Use
time.perf_counter_ns() and time.monotonic_ns() added in Python 3.7 to
avoid this precision loss.
2020-11-16 13:21:45 +01:00
Yash Shete aa01011003
bpo-42153 Fix link to IMAP documents in imaplib.rst (GH-23297)
The University of Washington stopped hosting the IMAP documents. Link to a rescued copy on GitHub.
2020-11-15 21:02:35 -08:00
Raymond Hettinger c272d40e5b
More updates to the descriptor howto guide (GH-23238) 2020-11-15 17:44:28 -08:00
Dominik1123 c3b9592244
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254) 2020-11-15 17:30:55 -08:00
Hai Shi 2b39da4997
bpo-41832: Restore note about NULL in PyType_Slot.pfunc (GH-23243) 2020-11-14 13:03:42 +01:00
Thomas Grainger 8836574a0f
fix typo in ThreadedChildWatcher docs (GH-23277) 2020-11-14 14:02:15 +02:00
Brett Cannon d2e94bb084
bpo-42131: Add PEP 451-related methods to zipimport (GH-23187)
Specifically, find_spec(), create_module(), and exec_module().

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2020-11-13 15:14:58 -08:00
Christian Heimes cd9fed6afb
bpo-41001: Add os.eventfd() (#20930)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-11-13 19:48:52 +01:00
Jürgen Gmach bbeb2d266d
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) 2020-11-13 13:15:37 -05:00
Christian Heimes f97406be4c
bpo-40968: Send http/1.1 ALPN extension (#20959)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-13 16:37:52 +01:00
Dong-hee Na 09490a109f
bpo-42042: Use ids attribute instead of names attribute (GH-22739) 2020-11-14 00:15:17 +09:00
Mario Corchero 750c5abf43
bpo-42308: Add threading.__excepthook__ (GH-23218)
Add threading.__excepthook__ to allow retrieving the original value
of threading.excepthook in case it is set to a broken or a different
value.
2020-11-12 18:27:44 +01:00
Ammar Askar f9a8386e44
bpo-40932: Note security caveat of shlex.quote on Windows (GH-21502)
Added a note in the `subprocess` docs that recommend using `shlex.quote` without mentioning that this is only applicable to Unix. 

Also added a warning straight into the `shlex` docs since it only says "for simple syntaxes resembling that of the Unix shell" and says using `quote` plugs the security hole without mentioning this important caveat.
2020-11-10 23:29:56 -08:00
Batuhan Taskaya fa476fe132
bpo-39411: pyclbr rewrite on AST (#18103)
- Rewrite pyclbr using an AST processor
- Add is_async to the pyclbr.Function
2020-11-11 10:14:12 +03:00
Victor Stinner 95ce7cd0a6
bpo-1635741: Fix typo in PyModule_AddObjectRef() doc (GH-23234)
It is similar to PyModule_AddObject(), not to itself.
2020-11-11 01:52:26 +01:00
kj 78ba7c69ad
bpo-42294: Grammar fixes in doc glossary strong/weak refs (GH-23227) 2020-11-11 00:56:55 +01:00
Hai Shi a13b26cac1
bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931)
PyType_GetSlot() can now accept static types.

Co-Authored-By: Petr Viktorin <encukou@gmail.com>

Automerge-Triggered-By: GH:encukou
2020-11-10 12:53:46 -08:00
Victor Stinner ace3f9a0ce
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)
Fix _PyConfig_Read() if compute_path_config=0: use values set by
Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add
compute_path_config parameter to _PyConfig_InitPathConfig().

The following functions now return NULL if called before
Py_Initialize():

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

These functions no longer automatically computes the Python Path
Configuration. Moreover, Py_SetPath() no longer computes
program_full_path.
2020-11-10 21:10:22 +01:00
Vladimir Matveev 1e996c3a3b
bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#22780) 2020-11-10 12:09:55 -08:00
Joongi Kim 3eb2846225
Update whatsnew for 3.10 release about addition of contextlib.aclosing (GH-23217) 2020-11-10 17:19:11 +02:00
Petr Viktorin 0b9c4c6fcf
bpo-42171: Add PEP573-related items to the limited API (GH-23009) 2020-11-10 05:47:31 -08:00
Victor Stinner 23c5f93b83
bpo-42294: Add borrowed/strong reference to doc glossary (GH-23206)
Add "borrowed reference" and "strong reference" to the documentation
glossary.

Enhance also Py_INCREF() and Py_NewRef() documentation.
2020-11-09 13:40:47 +01:00
Tom Gringauz a117167d8d
bpo-41543: contextlib.nullcontext can fill in for an async context manager (GH-21870)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-11-09 14:34:07 +02:00
Ammar Askar 97e8b1eaea
bpo-40624: Add support for the XPath != operator in xml.etree (GH-22147) 2020-11-09 08:02:39 +01:00
Don Kirkby fd6f6fa403
Minor wording change in concurrent.futures. (GH-23194)
Fixes a grammar problem by adding a missing "as", and clarifies the wording of the valid ranges for max_workers.
2020-11-08 11:01:23 +02:00
Julien Palard ee2549c2ba
bpo-41028: Doc: Move switchers to docsbuild-scripts. (GH-20969) 2020-11-07 12:28:31 +01:00
Brett Cannon 825ac38332
bpo-42133: update parts of the stdlib to fall back to `__spec__.loader` when `__loader__` is missing (#22929) 2020-11-06 18:45:56 -08:00
Andre Delfino 7c01f1540f
Remove outdated reference to pywin32 from platform module (GH-22005) 2020-11-06 18:58:14 +00:00
Hai Shi 88c2cfd9ff
bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123) 2020-11-06 17:04:47 +01:00
Raymond Hettinger 803187796f
Minor grammar edits for the descriptor howto guide (GH-#23175) 2020-11-06 01:30:17 -08:00
Inada Naoki bde33e428d
bpo-42179: Doc/tutorial: Remove mention of __cause__ (GH-23162) 2020-11-06 11:45:01 +09:00
Zackery Spytz 91e93794d5
bpo-26389: Allow passing an exception object in the traceback module (GH-22610)
The format_exception(), format_exception_only(), and
print_exception() functions can now take an exception object as a positional-only argument.

Co-Authored-By: Matthias Bussonnier <bussonniermatthias@gmail.com>
2020-11-05 22:18:44 +00:00
Victor Stinner dc42af8fd1
bpo-42260: PyConfig_Read() only parses argv once (GH-23168)
The PyConfig_Read() function now only parses PyConfig.argv arguments
once: PyConfig.parse_argv is set to 2 after arguments are parsed.
Since Python arguments are strippped from PyConfig.argv, parsing
arguments twice would parse the application options as Python
options.

* Rework the PyConfig documentation.
* Fix _testinternalcapi.set_config() error handling.
* SetConfigTests no longer needs parse_argv=0 when restoring the old
  configuration.
2020-11-05 18:58:07 +01:00
kj 133aa2d581
[docs] fix wrongly named AsyncContextDecorator (GH-23164)
Also added versionchanged.
2020-11-05 18:16:27 +02:00
Victor Stinner 53a03aafd5
bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152)
Added Py_NewRef() and Py_XNewRef() functions to increment the reference
count of an object and return the object.
2020-11-05 15:02:12 +01:00
Kazantcev Andrey 178695b7ae
bpo-40816 Add AsyncContextDecorator class (GH-20516)
Co-authored-by: Yury Selivanov <yury@edgedb.com>
2020-11-05 10:52:24 +02:00
Victor Stinner 048a35659a
bpo-42260: Add _PyInterpreterState_SetConfig() (GH-23158)
* Inline _PyInterpreterState_SetConfig(): replace it with
  _PyConfig_Copy().
* Add _PyErr_SetFromPyStatus()
* Add _PyInterpreterState_GetConfigCopy()
* Add a new _PyInterpreterState_SetConfig() function.
* Add an unit which gets, modifies, and sets the config.
2020-11-05 00:45:56 +01:00
Victor Stinner 8021875bbc
bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)
Added PyModule_AddObjectRef() function: similar to
PyModule_AddObjectRef() but don't steal a reference to the value on
success.
2020-11-04 13:59:15 +01:00
Victor Stinner 3529718925
bpo-42236: os.device_encoding() respects UTF-8 Mode (GH-23119)
On Unix, the os.device_encoding() function now returns 'UTF-8' rather
than the device encoding if the Python UTF-8 Mode is enabled.
2020-11-04 11:20:10 +01:00
Mario Corchero 0001a1b69e
bpo-42251: Add gettrace and getprofile to threading (GH-23125)
This allows to retrieve the functions that were set in these two, which might differ from sys.gettrace and sys.getprofile within a thread.
2020-11-04 09:27:43 +00:00
Matthew Suozzo bffb137cb5
Fix incorrect links in ast docs (GH-23017) 2020-11-03 23:28:42 +02:00
Victor Stinner 4b9aad4999
bpo-42236: Enhance init and encoding documentation (GH-23109)
Enhance the documentation of the Python startup, filesystem encoding
and error handling, locale encoding. Add a new "Python UTF-8 Mode"
section.

* Add "locale encoding" and "filesystem encoding and error handler"
  to the glossary
* Remove documentation from Include/cpython/initconfig.h: move it to
  Doc/c-api/init_config.rst.
* Doc/c-api/init_config.rst:

  * Document command line options and environment variables
  * Document default values.

* Add a new "Python UTF-8 Mode" section in Doc/library/os.rst.
* Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs.
* Document how Python selects the filesystem encoding and error
  handler at a single place: PyConfig.filesystem_encoding and
  PyConfig.filesystem_errors.
* PyConfig: move orig_argv member at the right place.
2020-11-02 16:49:54 +01:00
Julien Danjou 64366fa9b3
bpo-41435: Add sys._current_exceptions() function (GH-21689)
This adds a new function named sys._current_exceptions() which is equivalent ot
sys._current_frames() except that it returns the exceptions currently handled
by other threads. It is equivalent to calling sys.exc_info() for each running
thread.
2020-11-02 16:16:25 +02:00
Jakub Stasiak 3d86d090dc
bpo-42230: Improve asyncio documentation regarding accepting sets vs iterables (GH-23073)
People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] https://github.com/aio-libs/aiokafka/pull/672
[2] 620989bac5/stdlib/3/asyncio/tasks.pyi (L161)
[3] 620989bac5/stdlib/3/asyncio/tasks.pyi (L40)
2020-11-02 12:56:35 +02:00
Joongi Kim 6e8dcdaaa4
bpo-41229: Update docs for explicit aclose()-required cases and add contextlib.aclosing() method (GH-21545)
This is a PR to:

 * Add `contextlib.aclosing` which ia analogous to `contextlib.closing` but for async-generators with an explicit test case for [bpo-41229]()
 * Update the docs to describe when we need explicit `aclose()` invocation.

which are motivated by the following issues, articles, and examples:

 * [bpo-41229]()
 * https://github.com/njsmith/async_generator
 * https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#cleanup-in-generators-and-async-generators
 * https://www.python.org/dev/peps/pep-0533/
 * https://github.com/achimnol/aiotools/blob/ef7bf0cea7af/src/aiotools/context.py#L152

Particuarly regarding [PEP-533](https://www.python.org/dev/peps/pep-0533/), its acceptance (`__aiterclose__()`) would make this little addition of `contextlib.aclosing()` unnecessary for most use cases, but until then this could serve as a good counterpart and analogy to `contextlib.closing()`. The same applies for `contextlib.closing` with `__iterclose__()`.
Also, still there are other use cases, e.g., when working with non-generator objects with `aclose()` methods.
2020-11-02 00:02:48 -08:00
Raymond Hettinger e9208f0e74
Minor formatting edits to the descriptor howto guide (GH-23092) 2020-11-01 20:15:50 -08:00
Raymond Hettinger 74fa464b81
Add member objects to the descriptor howto guide (GH-23084) 2020-11-01 18:02:37 -08:00
Victor Stinner e662c398d8
bpo-42236: Use UTF-8 encoding if nl_langinfo(CODESET) fails (GH-23086)
If the nl_langinfo(CODESET) function returns an empty string, Python
now uses UTF-8 as the filesystem encoding.

In May 2010 (commit b744ba1d14), I
modified Python to log a warning and use UTF-8 as the filesystem
encoding (instead of None) if nl_langinfo(CODESET) returns an empty
string.

In August 2020 (commit 94908bbc15), I
modified Python startup to fail with a fatal error and a specific
error message if nl_langinfo(CODESET) returns an empty string. The
intent was to prevent guessing the encoding and also investigate user
configuration where this case happens.

In 10 years (2010 to 2020), I saw zero user report about the error
message related to nl_langinfo(CODESET) returning an empty string.

Today, UTF-8 became the defacto standard and it's safe to make the
assumption that the user expects UTF-8. For example,
nl_langinfo(CODESET) can return an empty string on macOS if the
LC_CTYPE locale is not supported, and UTF-8 is the default encoding
on macOS.

While this change is likely to not affect anyone in practice, it
should make UTF-8 lover happy ;-)

Rewrite also the documentation explaining how Python selects the
filesystem encoding and error handler.
2020-11-01 23:07:23 +01:00
Raymond Hettinger 148c76b27c
Expand and clarify the "Invoking Descriptors" section of the Descriptor HowTo (GH-23078) 2020-11-01 09:10:06 -08:00
Dong-hee Na 7feb54a634
bpo-37483: Add PyObject_CallOneArg() in the What's New in Python 3.9 (GH-23062) 2020-11-01 22:04:35 +09:00
kj 3bf0d02f28
bpo-42198: New section in stdtypes for type annotation types (GH-23063) 2020-10-31 13:25:44 -07:00
kj d21cb2d5ee
bpo-42198: Improve consistency of Union docs (GH-23029)
No backport is required since union is only in 3.10.

This addresses "3. Consistency nitpicks for Union's docs" in the bpo.

Please skip news. Thank you.
2020-10-31 08:08:17 -07:00
kj bcbf758476
bpo-42198: Document __new__ for types.GenericAlias (GH-23039) 2020-10-30 23:02:38 -07:00
Matti Picus 99608c733c
DOC: attribute PyPy for the idea behind LOAD_ATTR cache (GH-23036)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-10-30 14:52:39 +00:00
kj 9129af6050
bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)
Follow up to 7cdf30fff3 and 4173320920. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
2020-10-29 21:01:17 -07:00
Teugea Ioan-Teodor 3317466061
bpo-42061: Document __format__ for IP addresses (GH-23018)
Automerge-Triggered-By: GH:ericvsmith
2020-10-29 15:17:59 -07:00
Rafael Fontenelle b76a840021
bpo-42180: fix plural in arguments and control (GH-23015)
https://bugs.python.org/issue42180
2020-10-29 20:48:21 +00:00
Victor Stinner 5776663675
bpo-42029: Remove IRIX code (GH-23023)
IRIX code was slowy removed in Python 2.4 (--with-sgi-dl), Python 3.3
(Irix threads), and Python 3.7.
2020-10-29 15:16:23 +01:00
Zackery Spytz df59273c7a
bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639)
Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a
hardcoded 3.
2020-10-29 02:44:35 -07:00
kj 4173320920
bpo-41805: Documentation for PEP 585 (GH-22615) 2020-10-27 14:37:18 -07:00
Andre Delfino 95f710c557
bpo-6761: Enhance __call__ documentation (GH-7987) 2020-10-27 17:18:57 +01:00
Victor Stinner 84f7382215
bpo-42157: Rename unicodedata.ucnhash_CAPI (GH-22994)
Removed the unicodedata.ucnhash_CAPI attribute which was an internal
PyCapsule object. The related private _PyUnicode_Name_CAPI structure
was moved to the internal C API.

Rename unicodedata.ucnhash_CAPI as unicodedata._ucnhash_CAPI.
2020-10-27 04:36:22 +01:00
Georges Toth 303aac8c56
bpo-30681: Support invalid date format or value in email Date header (GH-22090)
I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07.

The issue being solved () is still relevant. The original PR #10783 was closed as
the final request changes were not applied and since abandoned.

In this new PR I have re-used the original patch plus applied both comments from the review, by @maxking and @pganssle.


For reference, here is the original PR description:
In email.utils.parsedate_to_datetime(), a failure to parse the date, or invalid date components (such as hour outside 0..23) raises an exception. Document this behaviour, and add tests to test_email/test_utils.py to confirm this behaviour.

In email.headerregistry.DateHeader.parse(), check when parsedate_to_datetime() raises an exception and add a new defect InvalidDateDefect; preserve the invalid value as the string value of the header, but set the datetime attribute to None.

Add tests to test_email/test_headerregistry.py to confirm this behaviour; also added test to test_email/test_inversion.py to confirm emails with such defective date headers round trip successfully.

This pull request incorporates feedback gratefully received from @bitdancer, @brettcannon, @Mariatta and @warsaw, and replaces the earlier PR #2254.

Automerge-Triggered-By: GH:warsaw
2020-10-26 17:31:06 -07:00
Victor Stinner 920cb647ba
bpo-42157: unicodedata avoids references to UCD_Type (GH-22990)
* UCD_Check() uses PyModule_Check()
* Simplify the internal _PyUnicode_Name_CAPI structure:

  * Remove size and state members
  * Remove state and self parameters of getcode() and getname()
    functions

* Remove global_module_state
2020-10-26 19:19:36 +01:00
Victor Stinner 47e1afd2a1
bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (GH-22713)
The private _PyUnicode_Name_CAPI structure of the PyCapsule API
unicodedata.ucnhash_CAPI moves to the internal C API. Moreover, the
structure gets a new state member which must be passed to the
getcode() and getname() functions.

* Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h
* unicodedata module is now built with Py_BUILD_CORE_MODULE.
* unicodedata: move hashAPI variable into unicodedata_module_state.
2020-10-26 16:43:47 +01:00
Antoine 0f25c231b3
Add a link to buffer protocol in bytearray() doc (GH-22675) 2020-10-26 14:26:34 +09:00
Raymond Hettinger 3cde3788b6
bpo-39108: Document threading issues for random.gauss() (GH-22928) 2020-10-25 07:59:01 -07:00
Raymond Hettinger e6a7ea4f2e
Split-out a fourth section in the descriptor HowTo guide (GH-22965) 2020-10-25 07:12:50 -07:00
Raymond Hettinger 4a9c637938
Second round of updates to the descriptor howto guide (GH-22946) 2020-10-24 20:34:39 -07:00
Raymond Hettinger 48be6b1ef7
bpo-42127: Document effect of cached_property on key-sharing dictionaries (GH-22930) 2020-10-24 18:17:17 -07:00
Andre Delfino e01e442125
[doc] Fix link to abc.ABCMeta.register in Glossary (GH-22932) 2020-10-24 19:59:17 +05:30
Terry Jan Reedy 805ef73ad0
bpo-42139: Update What's New 3.9 for master (#22936) 2020-10-23 20:59:33 -07:00
Raymond Hettinger 8e5b0fdce3
bpo-19072: Update descriptor howto for decorator chaining (GH-22934) 2020-10-23 18:37:27 -07:00
Brett Cannon 04523c5bd6
Mention in "What's New" that the import system is starting to be cleaned up (GH-22931)
Automerge-Triggered-By: GH:brettcannon
2020-10-23 18:10:54 -07:00
Raymond Hettinger 8d3d7314d4
Create a primer section for the descriptor howto guide (GH-22906) 2020-10-23 12:55:39 -07:00
Zackery Spytz ec388cfb4e
bpo-38486: Fix dead qmail links in the mailbox docs (GH-22239) 2020-10-22 16:33:28 -07:00
Batuhan Taskaya b37c994e5a
bpo-42086: Document AST operator nodes acts as a singleton (GH-22896)
Automerge-Triggered-By: GH:gvanrossum
2020-10-22 09:02:43 -07:00
Philippe Ombredanne b6f2fc9040
bpo-25655: Improve Win DLL loading failures doc (GH-22372)
Add documentation to help diagnose CDLL dependent DLL loading errors
on windows for OSError with message:
"[WinError 126] The specified module could not be found"
This error is otherwise difficult to diagnose.
2020-10-22 16:39:18 +01:00
larryhastings 283f9a253b
Remove 3.5 from Doc version switcher in master. (#22886) 2020-10-22 06:16:21 -07:00
Brett Cannon 3c69f0c933
bpo-41910: specify the default implementations of object.__eq__ and object.__ne__ (GH-22874)
See Objects/typeobject.c:object_richcompare() for the implementation of this in CPython.

Automerge-Triggered-By: GH:brettcannon
2020-10-21 16:24:38 -07:00
Pablo Galindo b451b0e9a7
bpo-38980: Add -fno-semantic-interposition when building with optimizations (GH-22862) 2020-10-21 22:46:52 +01:00
Géry Ogam 27f1bd8787
bpo-35181: Correct importlib documentation for some module attributes (GH-15190)
@ericsnowcurrently This PR will change the following:

In the library documentation importlib.rst:

- `module.__package__` can be `module.__name__` for packages;
- `spec.parent` can be `spec.__name__` for packages;
- `spec.loader` is not `None` for namespaces packages.

In the language documentation import.rst:

- `spec.loader` is not `None` for namespace packages.

Automerge-Triggered-By: GH:warsaw
2020-10-21 14:17:35 -07:00
kpinc f8b1ccd63c
Fix bpo-39416: Change "Numeric" to lower case; an english word, not a class name (GH-22867)
This is a trivial fix to [bpo-39416](), which didn't come up until it was already committed

```
Change "Numeric" to "numeric".

I believe this is trivial enough to not need an issue or a NEWS entry, although
I'm unclear on what branches the original pull request received backports.
```

Automerge-Triggered-By: GH:merwok
2020-10-21 13:34:15 -07:00
Raúl Cumplido caff2934f4
bpo-41959: Fix grammar around class asyncio.MultiLoopChildWatcher text (GH-22580)
While translating the following document to Spanish we found there is a grammar issue on the original documentation.
2020-10-21 12:05:48 -07:00
kpinc c60394c7fc
bpo-39416: Document some restrictions on the default string representations of numeric classes (GH-18111)
[bpo-39416](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/python-dev@python.org/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
2020-10-21 10:13:50 -07:00
Zackery Spytz cb115e36e1
Doc: Fix a typo/error in the docs for cached bytecode (GH-22445) 2020-10-21 17:36:03 +09:00
Andre Delfino fb2e94692e
Doc: Do not suggest `s[::-1]` for reversed order (GH-22457) 2020-10-21 17:25:07 +09:00
Andre Delfino eba109a28f
Doc: Remove old Python version from future stmt (GH-21802) 2020-10-21 14:45:13 +09:00
Andre Delfino 4642ccd1c3
Doc: Do not encourage using a base class name in a derived class (GH-22177) 2020-10-21 14:25:05 +09:00
Максим 5f22741340
bpo-23706: Add newline parameter to pathlib.Path.write_text (GH-22420) (GH-22420)
* Add _newline_ parameter to `pathlib.Path.write_text()`
* Update documentation of `pathlib.Path.write_text()`
* Add test case for `pathlib.Path.write_text()` calls with _newline_ parameter passed

Automerge-Triggered-By: GH:methane
2020-10-20 19:08:19 -07:00
kj 7cdf30fff3
bpo-42010: [docs] Clarify subscription of types (GH-22822) 2020-10-20 16:38:08 -07:00
Florian Dahlitz 2d55aa9e37
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2020-10-20 17:27:07 -04:00
Paul Moore 5ab27cc518
bpo-42041: Clarify how subprocess searches for the executable (GH-22715)
Clarify in the subprocess documentation how searching for the executable to run works, noting that ``sys.executable`` is the recommended way to find the current interpreter.
2020-10-20 21:02:24 +01:00
Andre Delfino 3393624b6d
Minor tweaks to typing union objects doc (GH-22741)
Automerge-Triggered-By: @merwok
2020-10-20 13:00:56 -07:00
Saiyang Gou 3f7e990fd4
bpo-41192: Add documentation of undocumented audit events (GH-21308) 2020-10-20 15:23:15 -04:00
Andrew Kuchling 0c37269be7
bpo-41192: Clarify the sys module's description of the auditing feature (GH-22768)
Co-authored-by: Éric Araujo <merwok@netwok.org>
2020-10-20 10:41:02 -04:00
Andrey Doroschenko ec42789e6e
bpo-39693: mention KeyError in tarfile extractfile documentation (GH-18639)
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
2020-10-20 10:05:01 -04:00
Zackery Spytz ff1ae3dd33
bpo-30612: Tweak Windows registry path syntax in the docs (GH-20281) 2020-10-20 13:01:12 +01:00
Tomer Cohen 5b57fa6940
Doc: Add missing spaces after period for `posix_spawn` (GH-22730) 2020-10-20 18:08:58 +09:00
Pablo Galindo 109826c850
bpo-42093: Add opcode cache for LOAD_ATTR (GH-22803) 2020-10-20 06:22:44 +01:00
Raymond Hettinger 871934d4cf
bpo-4356: Add key function support to the bisect module (GH-20556) 2020-10-19 22:04:01 -07:00
Ruben Vorderman 23c0fb8edd
bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and F_SETPIPE_SZ to fcntl. (GH-21921)
* Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module
* Add pipesize parameter for subprocess.Popen class

This will allow the user to control the size of the pipes.
On linux the default is 64K. When a pipe is full it blocks for writing.
When a pipe is empty it blocks for reading. On processes that are
very fast this can lead to a lot of wasted CPU cycles. On a typical
Linux system the max pipe size is 1024K which is much better.
For high performance-oriented libraries such as xopen it is nice to
be able to set the pipe size.

The workaround without this feature is to use my_popen_process.stdout.fileno() in
conjuction with fcntl and 1031 (value of F_SETPIPE_SZ) to acquire this behavior.
2020-10-19 16:30:02 -07:00
Jakub Stasiak f85658a098
bpo-40901: Describe what "interface name" means on Windows (GH-20694) 2020-10-19 23:30:58 +01:00
Alex Gaynor 3a8fdb2879
bpo-41784: make PyUnicode_AsUTF8AndSize part of the limited API (GH-22252) 2020-10-19 23:17:50 +01:00
Zackery Spytz 4dfb190a33
bpo-41217: Fix incorrect note in the asyncio.create_subprocess_shell() docs (GH-21360)
On Windows, the default asyncio event loop is ProactorEventLoop (as of 3.8).
2020-10-19 23:08:34 +01:00
Michel Samia 33242a9328
bpo-41292: Fixes dead link to cx_freeze from Windows FAQ (GH-21463) 2020-10-19 23:02:43 +01:00
abdo 5d9e657517
Link to the msvcrt module from the Windows FAQ (#22268) 2020-10-19 22:46:21 +01:00
Irit Katriel fa8748271a
bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) 2020-10-19 22:27:16 +01:00
Saiyang Gou ebc8c38287
bpo-41192: Fix some broken anchors for audit event entries (#21310) 2020-10-19 10:52:42 -04:00
Batuhan Taskaya 155938907c
bpo-40484: Document compiler flags under AST module (GH-19885)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-10-19 02:14:11 +01:00
Shantanu 67f04878de
3.9 whatsnew: fix bpo issue for AST change (GH-22742) 2020-10-18 18:39:26 +03:00
Andre Delfino 975d10a4f8
[doc] Add mentions of PEP 613 (TypeAlias) to docs (GH-22733) 2020-10-16 19:34:01 -07:00
Zackery Spytz a22a19f354
bpo-40341: Remove some "discouraged solutions" in Doc/faq/programming.rst (GH-22726) 2020-10-16 11:44:17 -07:00
Saiyang Gou cf693e537d
Document that `test.support.bytecode_helper` is new in 3.9 (GH-22618) 2020-10-15 16:06:23 -03:00
Raymond Hettinger b67cbbda3a
Minor clarification (GH-22708) 2020-10-14 23:41:55 -07:00
Raymond Hettinger 302b6166fb
Update timings for the final release (GH-22697) 2020-10-14 10:04:04 -07:00
Hai Shi c5b049b91c
bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters (GH-22219) 2020-10-14 17:43:31 +02:00
Raymond Hettinger f2bd04f689
Improve recipe readability (GH-22685) 2020-10-13 16:41:26 -07:00
Raymond Hettinger 8b2ff4c03d
Add recipe for a version of random() with a larger population (GH-22664) 2020-10-13 11:54:21 -07:00
Vladimir Matveev cfb0f57ff8
bpo-41756: Export PyGen_Send and wrap it in if-defs (#22677) 2020-10-13 10:26:51 -07:00
Saiyang Gou ba06a70c82
Fix typo in "Context manager types" section in typing.rst (GH-22676)
Fix typo in the "Context manager types" section in `typing.rst`.

Automerge-Triggered-By: @gvanrossum
2020-10-12 16:34:33 -07:00
Vladimir Matveev 24a54c0bd4
Delete PyGen_Send (#22663) 2020-10-12 12:10:42 -07:00
Andre Delfino 8adf8d1ec4
[doc] Remove mention of async and await as soft keywords (GH-22144) 2020-10-12 14:52:30 +01:00
Anthony Sottile d5752aa5c9
Fix .. code-block :: directives in decimal.rst (GH-22571) 2020-10-11 19:26:50 +01:00
Gaurav Kamath 8197a93208
Fix typo (GH-22582)
/af/of/s

Automerge-Triggered-By: @Mariatta
2020-10-11 11:13:43 -07:00
abdo 0ff8a3b374
Fix typo in typing.rst (GH-22625) 2020-10-11 11:40:21 +05:30
Xie Yanbo a42759351b
Fix incorrect parameter name (GH-22613)
Automerge-Triggered-By: @Mariatta
2020-10-09 19:38:43 -07:00
Vladimir Matveev 037245c5ac
bpo-41756: Add PyIter_Send function (#22443) 2020-10-09 17:15:15 -07:00
Serhiy Storchaka e2ec0b27c0
bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)
Remove complex special methods __int__, __float__, __floordiv__,
__mod__, __divmod__, __rfloordiv__, __rmod__ and __rdivmod__
which always raised a TypeError.
2020-10-09 14:14:37 +03:00
Phil Elson 35f041dd01
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
`site.getusersitepackages()` returns the location of the user-specific site-packages directory
even when the user-specific site-packages is disabled.

```
$ python -s -m site
sys.path = [
    '/home/user/conda/lib/python37.zip',
    '/home/user/conda/lib/python3.7',
    '/home/user/conda/lib/python3.7/lib-dynload',
    '/home/user/conda/lib/python3.7/site-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
```

It was not practical to prevent the function from returning None if user-specific site-packages are disabled, since there are other uses of the function which are relying on this behaviour (e.g. `python -m site`).
2020-10-08 15:37:46 +09:00
Raymond Hettinger 4e0ce82058
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)
This reverts commit 58a7da9e12.
2020-10-07 16:43:44 -07:00
Mikhail Golubev 4f3c25043d
bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
2020-10-07 14:44:31 -07:00
Batuhan Taskaya 044a1048ca
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.

For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
2020-10-06 13:03:02 -07:00
Ben Avrahami bef7d299eb
bpo-41905: Add abc.update_abstractmethods() (GH-22485)
This function recomputes `cls.__abstractmethods__`.
Also update `@dataclass` to use it.
2020-10-06 10:40:50 -07:00
Brett Cannon d02d824e05
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505) 2020-10-05 09:42:21 -07:00
Terry Jan Reedy 060937da98
bpo-41774: Tweak new programming FAQ entry (GH-22562)
Remove mention of space in "remove multiple items from list".
2020-10-05 10:31:44 -04:00
Serhiy Storchaka dcc54215ac
bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552) 2020-10-05 12:32:00 +03:00
Fidget-Spinner 8e1dd55e63
bpo-41428: Documentation for PEP 604 (gh-22517) 2020-10-04 21:40:52 -07:00
scoder 40db798692
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) 2020-10-04 19:13:46 -04:00
Irit Katriel 1ed5443526
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) 2020-10-04 14:16:04 +01:00
Batuhan Taskaya e799aa8b92
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Also document that eval() does this (the same way).
2020-10-03 17:46:44 -07:00
Andre Delfino 7f54e563dc
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
This changes a few occurrences left behind by #22340.

Automerge-Triggered-By: @gvanrossum
2020-10-03 15:10:59 -07:00
Andre Delfino 3fe6148937
[doc] Fix link to abc.collections.Iterable (GH-22520)
Missed this occurrence before, sorry. Also changed "the PEP" to "PEP".

Automerge-Triggered-By: @gvanrossum
2020-10-03 08:51:13 -07:00
Ram Rachum f97e42ef4d
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) 2020-10-03 12:52:13 +03:00
Andre Delfino d4b9edd505
[doc] Fix link to abc.collections.Iterable (GH-22502)
Automerge-Triggered-By: @gvanrossum
2020-10-02 16:15:28 -07:00
Andre Delfino bd71a43340
Fix is_typeddict markup (#22501) 2020-10-02 15:36:26 -07:00
Campbell Barton 20ce62f009
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) 2020-10-02 19:18:01 +03:00
Victor Stinner 583ee5a5b1
bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)
The PyUnicode_InternImmortal() function is now deprecated and will be
removed in Python 3.12: use PyUnicode_InternInPlace() instead.
2020-10-02 14:49:00 +02:00
Andre Delfino c8bb24166e
[doc] Update references to NumPy (GH-22458)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
2020-10-01 16:22:14 -07:00
Robert Smallshire 58a7da9e12
bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)
* bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer().

The int.is_integer() method always returns True.

* bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True.

* bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int.

This default implementation is intended to reduce the workload for subclass
implementers. It is not robust in the presence of infinities or NaNs and
may have suboptimal performance for other types.

* bpo-26680: Adds Rational.is_integer which returns True if the denominator is one.

This implementation assumes the Rational is represented in it's
lowest form, as required by the class docstring.

* bpo-26680: Adds Integral.is_integer which always returns True.

* bpo-26680: Adds tests for Fraction.is_integer called as an instance method.

The tests for the Rational abstract base class use an unbound
method to sidestep the inability to directly instantiate Rational.
These tests check that everything works correct as an instance method.

* bpo-26680: Updates documentation for Real.is_integer and built-ins int and float.

The call x.is_integer() is now listed in the table of operations
which apply to all numeric types except complex, with a reference
to the full documentation for Real.is_integer().  Mention of
is_integer() has been removed from the section 'Additional Methods
on Float'.

The documentation for Real.is_integer() describes its purpose, and
mentions that it should be overridden for performance reasons, or
to handle special values like NaN.

* bpo-26680: Adds Decimal.is_integer to the Python and C implementations.

The C implementation of Decimal already implements and uses
mpd_isinteger internally, we just expose the existing function to
Python.

The Python implementation uses internal conversion to integer
using to_integral_value().

In both cases, the corresponding context methods are also
implemented.

Tests and documentation are included.

* bpo-26680: Updates the ACKS file.

* bpo-26680: NEWS entries for int, the numeric ABCs and Decimal.

Co-authored-by: Robert Smallshire <rob@sixty-north.com>
2020-10-01 17:30:08 +01:00
Max Smolens 63298930fb
Fix grammar in secrets module documentation (GH-22467)
From `In particularly,` to `In particular,`
2020-09-30 15:05:51 -07:00
Terry Jan Reedy 5b0181d1f6
bpo-41774: Add programming FAQ entry (GH-22402)
In the "Sequences (Tuples/Lists)" section, add
"How do you remove multiple items from a list".
2020-09-29 01:02:44 -04:00
Ram Rachum b0dfc75816
bpo-41773: Raise exception for non-finite weights in random.choices(). (GH-22441) 2020-09-28 18:32:10 -07:00
Hai Shi d332e7b816
bpo-41842: Add codecs.unregister() function (GH-22360)
Add codecs.unregister() and PyCodec_Unregister() functions
to unregister a codec search function.
2020-09-28 23:41:11 +02:00
Andre Delfino d9ab95ff1f
[doc] Leverage the fact that the actual types can now be indexed for typing (GH-22340)
This shows users that they can use the actual types. Using deprecated types is confusing.

This also prefers colections.abc.Sized instead of the alias typing.Sized. I guess the aliases were created to make it convenient to import all collections related types from the same place.

This should be backported to 3.9.

Automerge-Triggered-By: @gvanrossum
2020-09-27 12:07:04 -07:00
Emmanuel Arias 00eb063b66
bpo-41858: Clarify line in optparse doc (GH-22407)
The existing line is easily read as being incomplete.
2020-09-26 23:43:18 -04:00
Andre Delfino e8a2076e14
Revert "Fix all Python Cookbook links (#22205)" (GH-22424)
This commit reverts commit ac0333e1e1 as the original links are working again and they provide extended features such as comments and alternative versions.
2020-09-27 01:47:25 +01:00
Victor Stinner 98c16c991d
bpo-41833: threading.Thread now uses the target name (GH-22357) 2020-09-23 23:21:19 +02:00
Zackery Spytz 2e4dd336e5
bpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)
Add PyDateTime_DATE_GET_TZINFO() and PyDateTime_TIME_GET_TZINFO()
macros.
2020-09-23 14:43:45 -04:00
Terry Jan Reedy 9c4eac7f02
bpo-33822: Update IDLE section of What's New 3.8 (GH-22383) 2020-09-23 11:19:05 -04:00
Terry Jan Reedy 22b7616f26
bpo-41844: Add IDLE section to What's New 3.9 (GN-22382) 2020-09-23 11:17:26 -04:00
sblondon 48b0b1b121
bpo-37779 : Add information about the overriding behavior of ConfigParser.read (GH-15177)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
2020-09-23 14:28:58 +02:00
Victor Stinner 19c3ac92bf
bpo-41834: Remove _Py_CheckRecursionLimit variable (GH-22359)
Remove the global _Py_CheckRecursionLimit variable: it has been
replaced by ceval.recursion_limit of the PyInterpreterState
structure.

There is no need to keep the variable for the stable ABI, since
Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() were not usable
in Python 3.8 and older: these macros accessed PyThreadState members,
whereas the PyThreadState structure is opaque in the limited C API.
2020-09-23 14:04:57 +02:00
Ethan Furman d986d1657e
bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362)
use `str.__str__` for `StrEnum` so that `str(StrEnum.member)` is the same as directly accessing the string value of the `StrEnum` member
2020-09-22 13:00:07 -07:00
Terry Jan Reedy 947adcaa13
bpo-35764: Rewrite the IDLE Calltips doc section (GH-22363) 2020-09-22 13:21:58 -04:00
Bas van Beek 0d0e9fe2ff
bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` (GH-22336)
closes issue 41810
2020-09-22 08:55:34 -07:00
Ethan Furman 62e40d8450
Enum: add extended AutoNumber example (GH-22349) 2020-09-22 00:05:27 -07:00
Ethan Furman 0063ff4e58
bpo-41816: add `StrEnum` (GH-22337)
`StrEnum` ensures that its members were already strings, or intended to
be strings.
2020-09-21 17:23:13 -07:00
Andre Delfino 778ad926cb
[doc] Teach 0-args form of super in Programming FAQ (GH-22176) 2020-09-20 10:09:50 -07:00
Mark Dickinson c8c70e7876
Add missing whatsnew entry for TestCase.assertNoLogs (GH-22317) 2020-09-19 21:38:11 +01:00
Vladimir Matveev 2b05361bf7
bpo-41756: Introduce PyGen_Send C API (GH-22196)
The new API allows to efficiently send values into native generators
and coroutines avoiding use of StopIteration exceptions to signal 
returns.

ceval loop now uses this method instead of the old "private"
_PyGen_Send C API. This translates to 1.6x increased performance
of 'await' calls in micro-benchmarks.

Aside from CPython core improvements, this new API will also allow 
Cython to generate more efficient code, benefiting high-performance
IO libraries like uvloop.
2020-09-18 18:38:38 -07:00
Victor Stinner 8394500cca
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307)
Doc/requirements.txt becomes the reference for packages and package
versions needed to build the Python documentation.

* Doc/Makefile now uses Doc/requirements.txt
* .travis.yml now uses "make env" of Doc/Makefile
2020-09-18 16:23:18 +02:00
Dong-hee Na 6595cb0af4
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
* bpo-35293: Remove RemovedInSphinx40Warning

* Update Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

* bpo-35293: Apply Victor's review

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-18 18:22:36 +09:00
Victor Stinner 8af239eacf
bpo-41762: Fix usage of productionlist markup in the doc (GH-22281)
Use an unique identifier for the different grammars documented using
the Sphinx productionlist markup.

productionlist markups of the same grammar, like "expressions" or
"compound statements", use the same identifier "python-grammar".
2020-09-18 09:10:15 +02:00
Serhiy Storchaka 27201cddf3
Remove duplicated words words (GH-22298) 2020-09-18 09:54:42 +03:00
Terry Jan Reedy 5a8364780b
bpo-41808: Add What's New 3.9 entry missing from master (#22294)
Entry was added by bpo-40939, #21012 and #21039.
2020-09-17 21:56:58 -04:00
Serhiy Storchaka a33f2c2bae
bpo-27032, bpo-37328: Document removing HTMLParser.unescape(). (GH-22288) 2020-09-17 11:49:01 +03:00
Ethan Furman 7219e27087
Enum: make `Flag` and `IntFlag` members iterable (GH-22221) 2020-09-16 13:01:00 -07:00
Pablo Galindo a5634c4067
bpo-41746: Add type information to asdl_seq objects (GH-22223)
* Add new capability to the PEG parser to type variable assignments. For instance:
```
       | a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a }
```

* Add new sequence types from the asdl definition (automatically generated)
* Make `asdl_seq` type a generic aliasing pointer type.
* Create a new `asdl_generic_seq` for the generic case using `void*`.
* The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed.
* New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences.
* Changes all possible `asdl_seq` types to use specific versions everywhere.
2020-09-16 19:42:00 +01:00
Andre Delfino 83f6dcd207
[doc] Minor improvements to is_typeddict (GH-22280)
1. The check is on the type
2. Add link to TypeDict
2020-09-16 08:06:23 -07:00
Patrick Reader 0705ec8a14
bpo-41792: Add is_typeddict function to typing.py (GH-22254)
Closes issue41792.

Also closes https://github.com/python/typing/issues/751.
2020-09-15 21:58:32 -07:00
Tim Burke 47f6ec4c09
Doc: Fix broken manpage link (GH-21937)
sigprocmask is in section 2, not 3.
2020-09-15 20:26:06 -03:00
Andre Delfino ac0333e1e1
Fix all Python Cookbook links (#22205) 2020-09-15 21:13:26 +01:00
Mandeep 5531269f69
Improve the description of difflib in the documentation (GH-22253)
From "can produce difference information in various formats ..."
to " can produce information about file differences in various formats ..."

Automerge-Triggered-By: @Mariatta
2020-09-15 12:20:49 -07:00
Neeraj Samtani 7bcc6456ad
bpo-41776: Revise example of "continue" in the tutorial documentation (GH-22234)
Revise example of "continue" in the tutorial documentation
2020-09-15 09:39:29 -04:00
Ethan Furman 542e1df2b0
bpo-40721: add note about enum member name case (GH-22231)
* UPPER_CASE preferred as enum members are constants
2020-09-14 13:32:44 -07:00
Zackery Spytz 8f2b991eef
bpo-41646: Mention path-like objects support in the docs for shutil.copy() (GH-22208) 2020-09-14 20:28:46 +01:00
abdo efcbe786cf
Fix a typo in locale Docs (#22233) 2020-09-14 20:36:34 +03:00
Raymond Hettinger 457d4e97de
bpo-41513: Add docs and tests for hypot() (GH-22238) 2020-09-13 23:33:41 -07:00
Emmanuel Arias 94bfdee25d
bpo-41778: Change a punctuation on documentation. (GH-22229)
On this paragrapah the clarification about IIS7 seems there's not
connection beacuase is in other sentence. Move the punctuation
to connect both the last sentence with the information in the
parenthesis.

I think the NEWS is not necessary here.

Automerge-Triggered-By: @ericvsmith
2020-09-13 14:05:44 -07:00
Sergey Fedoseev b48389d950
bpo-33239: Fix default value of 'buffering' parameter in docs of tempfile.* functions (GH-21763)
`None` doesn't work:

```python
>>> import tempfile
>>> tempfile.TemporaryFile(buffering=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sergey/tmp/cpython-dev/Lib/tempfile.py", line 607, in TemporaryFile
    return _io.open(fd, mode, buffering=buffering,
TypeError: 'NoneType' object cannot be interpreted as an integer
```

Automerge-Triggered-By: @vsajip
2020-09-13 10:59:01 -07:00
Norbert Cyran c75330605d
bpo-41672: Fix type mismatches in imaplib docs (GH-22207) 2020-09-12 16:58:56 +09:00
Stargirl Flowers fb27187203
[doc] struct: update note about network byte order form to be more helpful (GH-22201)
Update the sentence to provide some context on why network byte order is defined as big endian.
2020-09-11 08:20:12 -07:00
Benjamin Peterson 3304cbd990
Doc: Fix alphabetical ordering of removeprefix/suffix. (GH-22194) 2020-09-11 08:59:02 +09:00
Mark Roseman 06d0b8b67e
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188)
The new link responds much faster and begins with a short explanation of the status of the doc.
2020-09-10 16:04:20 -04:00
Bar Harel 1e874d5bec
Update logging documentation to tidy up formatting (GH-22173) 2020-09-10 11:50:23 +01:00
Andre Delfino 788b79fa7b
[doc] Remove superfluous comment about equal in f-strings (GH-22006)
Automerge-Triggered-By: @kushaldas
2020-09-09 23:33:13 -07:00
Andre Delfino 7a797a3967
Add missing colon to IDLE doc markup (GH-22007) 2020-09-09 18:17:14 -04:00
Vinay Sajip 76553e5d2e
Add minor clarification in logging documentation. (GH-22167) 2020-09-09 11:21:22 +01:00
Hai Shi 1e2f051a61
bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec in refcounts.dat (GH-22112)
Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat
2020-09-09 11:48:44 +02:00
Andre Delfino 594f0ce73b
[doc] Fix padding in timeit (GH-22152)
Compare -p and -u options help in rendered output to see the difference.
2020-09-08 16:39:19 -07:00
Erlend Egeberg Aasland 207c321f13
bpo-40744: Drop support for SQLite pre 3.7.3 (GH-20909)
Remove code required to support SQLite pre 3.7.3.

Co-written-by: Berker Peksag <berker.peksag@gmail.com>
Co-written-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2020-09-07 22:26:54 +01:00
Andre Delfino 5bfd60fc2b
[doc] Add link to Generic in typing (GH-22125) 2020-09-06 22:29:38 -07:00
Zackery Spytz 5371a464ce
closes bpo-41723: Fix an error in the py_compile documentation. (GH-22110) 2020-09-05 22:39:23 -05:00
Andre Delfino 2623868ede
[doc] Fix padding in some typing definitions (GH-22114)
Automerge-Triggered-By: @gvanrossum
2020-09-05 16:40:25 -07:00
johnthagen 1264d0465a
Fix documented Python version for venv --upgrade-deps (GH-22113)
Fixes incorrect Python version added for `venv` `--upgrade-deps` in #13100. This feature was added in Python 3.9 not 3.8.

Relates to:

- 
- 1cba1c9aba

Automerge-Triggered-By: @vsajip
2020-09-05 13:53:47 -07:00
Zackery Spytz 51b84f8e96
bpo-38585: Remove references to defusedexpat (GH-22095)
defusedexpat is not maintained.
2020-09-04 13:57:48 -07:00
Serhiy Storchaka 306cfb3a37
bpo-40486: Specify what happens if directory content change diring iteration (GH-22025) 2020-09-04 21:19:30 +03:00
Vinay Sajip cdbff3527c
[doc] Update documentation on logging optimization. (GH-22075) 2020-09-03 19:44:12 +01:00
Mario Šaško 8516060076
[doc] Fix a typo in the graphlib docs (#22030) 2020-09-03 11:00:10 +01:00
Todd e223d06a8b
bpo-39883: Use BSD0 license for code in docs (GH-17635)
The PSF board approved this use.
2020-09-02 22:22:36 -07:00
Pablo Galindo 5a4a963a6c
Fix invalid escape sequences in the peg_highlight Sphinx extension (GH-22047) 2020-09-02 15:29:38 +01:00
Victor Stinner 51fece1bb8
bpo-41685: Don't pin setuptools version anymore in Doc/Makefile (GH-22062)
setuptools 50.0.2 is now compatible with Python 3.10:
https://github.com/pypa/setuptools/pull/2361
2020-09-02 13:11:21 +02:00
Victor Stinner c0d5c131d9
bpo-40204: Update Sphinx to version 3.2.1 in Doc/Makefile (GH-22043) 2020-09-02 12:29:31 +02:00
Andre Delfino 1d25f5bf7b
Remove reference to Boa Constructor. (GH-22012) 2020-09-01 22:22:55 -05:00
Andre Delfino dea82b6731
[doc] Remove references to PyChecker. (GH-22011) 2020-09-01 22:21:12 -05:00
Benjamin Peterson 700fa1b836
Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22031)
Follow up to f7c4e23642.
2020-09-01 20:36:42 -05:00
Andre Delfino f5a16b4dbf
[doc] Add link to FileHandler in logging (GH-21940)
Co-authored-by: Andrés Delfino <adelfino@onapsis.com>
2020-09-01 13:59:46 +01:00
Ned Deily a4c4e17f95
bpo-41685: Temporarily pin setuptools to 49.2.1 in Docs venv. (GH-22038)
See https://github.com/pypa/setuptools/pull/2361
2020-09-01 05:40:27 -04:00