summaryrefslogtreecommitdiffstats
path: root/Doc
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42260: PyConfig_Read() only parses argv once (GH-23168)Victor Stinner2020-11-051-92/+104
| | | | | | | | | | | | 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.
* [docs] fix wrongly named AsyncContextDecorator (GH-23164)kj2020-11-051-3/+5
| | | Also added versionchanged.
* bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152)Victor Stinner2020-11-052-0/+35
| | | | Added Py_NewRef() and Py_XNewRef() functions to increment the reference count of an object and return the object.
* bpo-40816 Add AsyncContextDecorator class (GH-20516)Kazantcev Andrey2020-11-051-0/+62
| | | | Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-42260: Add _PyInterpreterState_SetConfig() (GH-23158)Victor Stinner2020-11-041-0/+2
| | | | | | | | * 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.
* bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)Victor Stinner2020-11-042-14/+95
| | | | | Added PyModule_AddObjectRef() function: similar to PyModule_AddObjectRef() but don't steal a reference to the value on success.
* bpo-42236: os.device_encoding() respects UTF-8 Mode (GH-23119)Victor Stinner2020-11-041-0/+8
| | | | On Unix, the os.device_encoding() function now returns 'UTF-8' rather than the device encoding if the Python UTF-8 Mode is enabled.
* bpo-42251: Add gettrace and getprofile to threading (GH-23125)Mario Corchero2020-11-042-0/+28
| | | This allows to retrieve the functions that were set in these two, which might differ from sys.gettrace and sys.getprofile within a thread.
* Fix incorrect links in ast docs (GH-23017)Matthew Suozzo2020-11-031-6/+7
|
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-0216-296/+701
| | | | | | | | | | | | | | | | | | | | | 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.
* bpo-41435: Add sys._current_exceptions() function (GH-21689)Julien Danjou2020-11-021-0/+12
| | | | | | 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.
* bpo-42230: Improve asyncio documentation regarding accepting sets vs ↵Jakub Stasiak2020-11-021-4/+4
| | | | | | | | | | | | | | 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] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161 [3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40
* bpo-41229: Update docs for explicit aclose()-required cases and add ↵Joongi Kim2020-11-022-3/+46
| | | | | | | | | | | | | | | | | | | 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.
* Minor formatting edits to the descriptor howto guide (GH-23092)Raymond Hettinger2020-11-021-19/+20
|
* Add member objects to the descriptor howto guide (GH-23084)Raymond Hettinger2020-11-021-0/+156
|
* bpo-42236: Use UTF-8 encoding if nl_langinfo(CODESET) fails (GH-23086)Victor Stinner2020-11-012-22/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the nl_langinfo(CODESET) function returns an empty string, Python now uses UTF-8 as the filesystem encoding. In May 2010 (commit b744ba1d14c5487576c95d0311e357b707600b47), 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 94908bbc1503df830d1d615e7b57744ae1b41079), 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.
* Expand and clarify the "Invoking Descriptors" section of the Descriptor ↵Raymond Hettinger2020-11-012-38/+79
| | | | HowTo (GH-23078)
* bpo-37483: Add PyObject_CallOneArg() in the What's New in Python 3.9 (GH-23062)Dong-hee Na2020-11-011-0/+4
|
* bpo-42198: New section in stdtypes for type annotation types (GH-23063)kj2020-10-311-4/+14
|
* bpo-42198: Improve consistency of Union docs (GH-23029)kj2020-10-312-24/+15
| | | | | | | 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.
* bpo-42198: Document __new__ for types.GenericAlias (GH-23039)kj2020-10-312-2/+14
|
* DOC: attribute PyPy for the idea behind LOAD_ATTR cache (GH-23036)Matti Picus2020-10-301-1/+1
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)kj2020-10-302-44/+75
| | | Follow up to 7cdf30fff39ea97f403b5472096349998d190e30 and 4173320920706b49a004bdddd8d7108e8984e3fc. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
* bpo-42061: Document __format__ for IP addresses (GH-23018)Teugea Ioan-Teodor2020-10-292-4/+38
| | | Automerge-Triggered-By: GH:ericvsmith
* bpo-42180: fix plural in arguments and control (GH-23015)Rafael Fontenelle2020-10-291-1/+1
| | | https://bugs.python.org/issue42180
* bpo-42029: Remove IRIX code (GH-23023)Victor Stinner2020-10-291-3/+3
| | | | IRIX code was slowy removed in Python 2.4 (--with-sgi-dl), Python 3.3 (Irix threads), and Python 3.7.
* bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639)Zackery Spytz2020-10-292-5/+22
| | | | Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a hardcoded 3.
* bpo-41805: Documentation for PEP 585 (GH-22615)kj2020-10-273-0/+208
|
* bpo-6761: Enhance __call__ documentation (GH-7987)Andre Delfino2020-10-271-1/+1
|
* bpo-42157: Rename unicodedata.ucnhash_CAPI (GH-22994)Victor Stinner2020-10-271-1/+6
| | | | | | | 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.
* bpo-30681: Support invalid date format or value in email Date header (GH-22090)Georges Toth2020-10-272-2/+7
| | | | | | | | | | | | | | | | | | | | 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
* bpo-42157: unicodedata avoids references to UCD_Type (GH-22990)Victor Stinner2020-10-261-4/+2
| | | | | | | | | | * 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
* bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (GH-22713)Victor Stinner2020-10-261-0/+6
| | | | | | | | | | 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.
* Add a link to buffer protocol in bytearray() doc (GH-22675)Antoine2020-10-261-2/+2
|
* bpo-39108: Document threading issues for random.gauss() (GH-22928)Raymond Hettinger2020-10-251-0/+7
|
* Split-out a fourth section in the descriptor HowTo guide (GH-22965)Raymond Hettinger2020-10-251-46/+50
|
* Second round of updates to the descriptor howto guide (GH-22946)Raymond Hettinger2020-10-251-96/+156
|
* bpo-42127: Document effect of cached_property on key-sharing dictionaries ↵Raymond Hettinger2020-10-251-9/+24
| | | | (GH-22930)
* [doc] Fix link to abc.ABCMeta.register in Glossary (GH-22932)Andre Delfino2020-10-241-1/+1
|
* bpo-42139: Update What's New 3.9 for master (#22936)Terry Jan Reedy2020-10-241-65/+299
|
* bpo-19072: Update descriptor howto for decorator chaining (GH-22934)Raymond Hettinger2020-10-241-3/+13
|
* Mention in "What's New" that the import system is starting to be cleaned up ↵Brett Cannon2020-10-241-0/+17
| | | | | (GH-22931) Automerge-Triggered-By: GH:brettcannon
* Create a primer section for the descriptor howto guide (GH-22906)Raymond Hettinger2020-10-233-59/+499
|
* bpo-38486: Fix dead qmail links in the mailbox docs (GH-22239)Zackery Spytz2020-10-221-10/+4
|
* bpo-42086: Document AST operator nodes acts as a singleton (GH-22896)Batuhan Taskaya2020-10-221-0/+7
| | | Automerge-Triggered-By: GH:gvanrossum
* bpo-25655: Improve Win DLL loading failures doc (GH-22372)Philippe Ombredanne2020-10-221-0/+15
| | | | | | 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.
* Remove 3.5 from Doc version switcher in master. (#22886)larryhastings2020-10-222-2/+0
|
* bpo-41910: specify the default implementations of object.__eq__ and ↵Brett Cannon2020-10-211-6/+8
| | | | | | | object.__ne__ (GH-22874) See Objects/typeobject.c:object_richcompare() for the implementation of this in CPython. Automerge-Triggered-By: GH:brettcannon
* bpo-38980: Add -fno-semantic-interposition when building with optimizations ↵Pablo Galindo2020-10-211-0/+8
| | | | (GH-22862)
* bpo-35181: Correct importlib documentation for some module attributes (GH-15190)Géry Ogam2020-10-212-21/+11
| | | | | | | | | | | | | | | @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