Commit Graph

23905 Commits

Author SHA1 Message Date
Victor Stinner 75e59a97f5
bpo-42856: Add --with-wheel-pkg-dir=PATH configure option (GH-24210)
Add --with-wheel-pkg-dir=PATH option to the ./configure script. If
specified, the ensurepip module looks for setuptools and pip wheel
packages in this directory: if both are present, these wheel packages
are used instead of ensurepip bundled wheel packages.

Some Linux distribution packaging policies recommend against bundling
dependencies. For example, Fedora installs wheel packages in the
/usr/share/python-wheels/ directory and don't install the
ensurepip._bundled package.

ensurepip: Remove unused runpy import.
2021-01-20 17:07:21 +01:00
Conchylicultor e0e398ef18
Fix typos in unittest documentation (GH-24194)
* addCleanupClass  -> addClassCleanup
* doCleanupsClass -> doClassCleanups
2021-01-20 18:38:37 +05:30
Erlend Egeberg Aasland e982fe496b
bpo-42048: Clinic Howto: Document AC's defining_class converter (GH-23978) 2021-01-20 12:19:57 +01:00
Hong Xu 1459fed92c
Doc: os.path.abspath and Path.resolve are also different (GH-23276) 2021-01-20 11:20:00 +01:00
Pablo Galindo e485be5b6b
Add a clarification for the object-domain allocators regarding pointer validity (GH-24253) 2021-01-19 13:09:06 +00:00
Pablo Galindo bc450f9694
Add a paragraph about allocation domains to the C-API docs (GH-24252) 2021-01-18 22:20:57 +00:00
Irit Katriel 4c94d74152
bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)
Use it to reduce the time and memory taken up by several of traceback's module-level functions.
2021-01-14 18:45:02 -08:00
Ken Jin 9712358277
Docs: Remove stray semicolon in init.rst (GH-23974)
Removed stray semicolon which was causing the docs to render weirdly (it's the function right under the one [here](https://docs.python.org/3/c-api/init.html#c._PyInterpreterState_GetEvalFrameFunc)).
2021-01-14 07:57:08 -08:00
Zackery Spytz 14cfa325c2
bpo-39273: Expose BUTTON5_* constants in the curses module if available (GH-17996) 2021-01-14 11:40:09 +02:00
Hugo van Kemenade c47c78b878
bpo-37324: Remove ABC aliases from collections (GH-23754)
Remove deprecated aliases to Abstract Base Classes from the
collections module.
2021-01-13 00:16:37 +01:00
Tomáš Hrnčiar fb35fa49d1
bpo-42870: Document change in argparse help output. (GH-24190) 2021-01-11 16:41:35 -08:00
Ken Jin ace008c531
Fix various ParamSpec errors in typing (GH-24176)
1. ParamSpec -> TypeVar for ``typing.Concatenate``
2. ParamSpec's call signature should align with its documentation.
Noticed in GH-24169
2021-01-10 16:11:41 -08:00
Victor Stinner 0e2a0f72cc
bpo-42802: Remove distutils bdist_wininst command (GH-24043)
The distutils bdist_wininst command deprecated in Python 3.8 has been
removed. The distutils bidst_wheel command is now recommended to
distribute binary packages on Windows.

* Remove Lib/distutils/command/bdist_wininst.py
* Remove PC/bdist_wininst/ project
* Remove Lib/distutils/command/wininst-*.exe programs
* Remove all references to bdist_wininst
2021-01-09 00:35:01 +01:00
Johan Dahlin 68e1f259be
Fix a typo in docs for typing.Concatenate (#24169)
Return param spec should be R, not T
2021-01-08 10:08:21 -08:00
Simon Willison 5c30145afb
bpo-42783: Documentation for asyncio.sleep(0) (#24002)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-01-07 12:03:18 +10:00
Yair Frid ff8458b918
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)
Automerge-Triggered-By: GH:brettcannon
2021-01-06 09:42:10 -08:00
Antonio Cuni 315fc52db1
bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602)
I think that none of these API calls can fail, but only few of them are
documented as such. Add the sentence "This function always succeeds" (which is
the same already used e.g. by PyNumber_Check) to all of them.
2021-01-06 12:38:26 +01:00
Berker Peksag 1a9f51ed12
bpo-14014: Clarify StreamWriter.reset() documentation (GH-13716) 2021-01-06 04:14:42 +02:00
Erlend Egeberg Aasland ddb5e11683
bpo-24464: Deprecate sqlite3.enable_shared_cache (GH-24008) 2021-01-06 02:36:04 +02:00
Vladimir f9949f82e1
bpo-38413: Remove outdated section about multithreading in sqlite3 (GH-23159) 2021-01-06 02:18:46 +02:00
Erlend Egeberg Aasland cf0b23908c
bpo-40810: Require SQLite 3.7.15 (GH-24106) 2021-01-06 02:02:43 +02:00
Pablo Galindo de833b6013
Fix 'make suspicious' for the itertools module (GH-24097) 2021-01-04 17:24:22 +00:00
Serhiy Storchaka 1470edd613
bpo-42681: Fix range checks for color and pair numbers in curses (GH-23874) 2021-01-03 22:51:11 +02:00
Zackery Spytz 6613676861
bpo-38308: Fix the "versionchanged" for the *weights* of harmonic_mean() (GH-23919) 2021-01-03 14:35:26 +02:00
Pablo Galindo 9e8fe1986c
bpo-42093: Tweak the what's new message about the new LOAD_ATTR opcode cache (GH-24070) 2021-01-03 04:37:46 +00:00
Ken Jin 11276cd9c4
bpo-41559: Documentation for PEP 612 (GH-24000) 2021-01-01 16:45:50 -08:00
Dong-hee Na de6f20a6de
Bring Python into the new year. (GH-24036) 2021-01-02 00:37:23 +09:00
Raymond Hettinger c8a7b8fa1b
bpo-42781: Document the mechanics of cached_property from a user viewpoint (GH-24031) 2020-12-31 17:05:58 -08:00
Tao He 3631d6deab
Fixes a typo in importlib.metadata. (#23921)
Signed-off-by: Tao He <sighingnow@gmail.com>
2020-12-31 11:37:53 -08:00
Jason R. Coombs dfdca85dfa
bpo-42382: In importlib.metadata, `EntryPoint` objects now expose `dist` (#23758)
* bpo-42382: In importlib.metadata, `EntryPoint` objects now expose a `.dist` object referencing the `Distribution` when constructed from a `Distribution`.

Also, sync importlib_metadata 3.3:

- Add support for package discovery under package normalization rules.
- The object returned by `metadata()` now has a formally-defined protocol called `PackageMetadata` with declared support for the `.get_all()` method.

* Add blurb

* Remove latent footnote.
2020-12-31 12:56:43 -05:00
Erlend Egeberg Aasland f4936ad1c4
bpo-42393: Raise OverflowError iso. DeprecationWarning on overflow in socket.ntohs and socket.htons (GH-23980) 2020-12-31 15:16:50 +02:00
Raymond Hettinger f421bfce80
Minor improvements to the convolve() recipe (GH-24012)
* Minor improvement to speed and space efficiency for the convolve() recipe
* Don't require convolve's kernel to be a sequence.
2020-12-30 12:51:19 -08:00
pxinwr 277ce3060b
bpo-27640: Add --disable-test-modules configure option (GH-23886)
Added --disable-test-modules option to the configure script:
don't build nor install test modules.

Patch by Xavier de Gaye, Thomas Petazzoni and Peixing Xin.

Co-Authored-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
2020-12-30 13:50:39 +01:00
Yurii Karabas c56387f80c
bpo-27794: Add `name` attribute to `property` class (GH-23967) 2020-12-30 01:51:24 -08:00
Andre Delfino 2edfc86f69
bpo-41224: Add versionadded for Symbol.is_annotated (GH-23861) 2020-12-29 15:32:10 +02:00
Michael Wayne Goodman 84402eb110
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
The descriptions of the `codes` and `messages` dictionaries in
`xml.parsers.expat.errors` were swapped, and this commit swaps them
back. For example, `codes` maps string descriptions of errors to numeric
error codes, not the other way around.
2020-12-29 14:33:15 +02:00
Zackery Spytz c56988b88f
bpo-42770: Fix a typo in the email.headerregistry docs (GH-23982)
Automerge-Triggered-By: GH:zware
2020-12-28 20:12:37 -08:00
Raymond Hettinger a9621bb301
bpo-42222: Modernize integer test/conversion in randrange() (#23064) 2020-12-28 11:10:34 -08:00
Erlend Egeberg Aasland abba83b4b9
bpo-42755: Fix sqlite3.Connection.backup docs (GH-23965)
The `pages` argument default value now reflects the implementation.
2020-12-27 22:35:17 +00:00
Raymond Hettinger 77fde8dc16
Add convolve() to the itertools recipes (GH-23928) 2020-12-25 16:43:20 -08:00
Ken Jin f0853bcedf
Sync what's new in 3.9 with 3.9 branch (GH-23943) 2020-12-25 23:08:17 +00:00
Desmond Cheong 36a779e64c
bpo-35728: Add root parameter to tkinter.font.nametofont() (GH-23885) 2020-12-25 23:18:06 +02:00
Gregory P. Smith 64abf37344
bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467)
When the modern text= spelling of the universal_newlines= parameter was added
for Python 3.7, check_output's special case around input=None was overlooked.
So it behaved differently with universal_newlines=True vs text=True.  This
reconciles the behavior to be consistent and adds a test to guarantee it.

Also clarifies the existing check_output documentation.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2020-12-24 20:57:21 -08:00
Raymond Hettinger cc3467a57b
bpo-38308: Add optional weighting to statistics.harmonic_mean() (GH-23914) 2020-12-23 19:52:09 -08:00
Batuhan Taskaya eee1c7745a
bpo-41960: Add globalns and localns parameters to inspect.signature and Signature.from_callable (GH-22583) 2020-12-24 01:45:13 +03:00
Raymond Hettinger 41b223d29c
bpo-9694: Fix misleading phrase "optional arguments" (GH-23858) 2020-12-23 09:40:56 -08:00
Matt Fowler d90ff37681
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881) 2020-12-23 12:44:52 +02:00
Raymond Hettinger 6afb730e2a
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884) 2020-12-22 09:24:26 -08:00
Andre Delfino 60eccd0956
[doc] Fix missing commas in signatures (#23693)
* Fix star in signatures

* Fix comma in signatures
2020-12-22 11:02:52 -05:00
Batuhan Taskaya fbc7723778
bpo-39159: Declare error that might be raised from literal_eval (GH-19899) 2020-12-21 16:15:40 -08:00
Géry Ogam d515c610c6
bpo-35790: Correct the description of sys.exc_info() and add a code example (GH-11625) 2020-12-21 14:13:08 +01:00
Colin Watson c95f8bc270
bpo-42669: Document that `except` rejects nested tuples (GH-23822)
In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural.  For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:

    try:
        self.getInputValue()
        return True
    except (InputErrors, SomethingElse):
        return False

As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple.  However, the reference documentation was never updated to match this new restriction.  Make it clear that the definition is no longer recursive.

Automerge-Triggered-By: GH:ericvsmith
2020-12-20 10:24:10 -08:00
Raymond Hettinger b0398a4b7f
bpo-42572: Improve argparse docs for the type parameter. (GH-23849) 2020-12-20 10:14:54 -08:00
sblondon 09a36cdfb7
bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855)
* Explain when the conversion is not possible with detect_types enabled
2020-12-19 17:52:39 -05:00
Andre Delfino c56f9df049
[doc] Mention with and except clauses in globals() (GH-13232) 2020-12-19 16:48:06 +01:00
Raymond Hettinger 5646414ae1
bpo-42559: Not that getrandbits() is non-negative. (GH-23843) 2020-12-18 17:03:10 -08:00
Raymond Hettinger 51f4688254
bpo-34805: Guarantee that __subclasses__() is in definition order. (GH-23844) 2020-12-18 16:53:50 -08:00
Irit Katriel fb34096140
bpo-24792: Fix zipimporter masking the cause of import errors (GH-22204)
zipimport's _unmarshal_code swallows import errors and then _get_module_code doesn't know the cause of the error, and returns the generic, and sometimes incorrect, 'could not find...'.

Automerge-Triggered-By: GH:brettcannon
2020-12-18 16:09:54 -08:00
Andre Delfino e8d2264210
bpo-36769: Document that fnmatch.filter supports any kind of iterable (#13039) 2020-12-18 20:10:20 +01:00
Ammar Askar 8c5d0347ef
bpo-34398: Allow glossary results to show up on search page (GH-8773) 2020-12-18 20:00:51 +01:00
kj d75f6f78e6
bpo-42675: Document collections.abc.Callable changes (GH-23839) 2020-12-18 09:39:26 -08:00
Matt Wozniski 84ebcf271a
bpo-17140: Document multiprocessing's ThreadPool (GH-23812)
Up until now, the `multiprocessing.pool.ThreadPool` class has gone
undocumented, despite being a public class in multiprocessing that is
included in `multiprocessing.pool.__all__`.
2020-12-18 13:05:46 +00:00
Julien Palard b9735420aa
bpo-42238: Check Misc/NEWS.d/next/ for reStructuredText issues. (GH-23802) 2020-12-18 10:48:08 +01:00
Mark Dickinson 886b2e5c7a
bpo-39096: Format specification documentation fixes for numeric types (GH-23575) 2020-12-18 10:24:06 +01:00
Zackery Spytz 074ad5123f
bpo-42670: Fix a missing word in the itertools.product() docs (GH-23823) 2020-12-17 12:24:43 -08:00
Andre Delfino 96a09df644
[doc] Fix a few margins due to bad markup (GH-23619) 2020-12-17 09:25:55 -08:00
Mark Shannon bf353f3c2d
bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly after raising or reraising an exception (GH-23803)
* Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626.

* Update importlib

* Add NEWS.
2020-12-17 13:55:28 +00:00
Andre Delfino dcc997cd28
[doc] Fix erroneous backslashes in signatures and names (GH-23658)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).

The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.
2020-12-16 17:37:28 -08:00
Matthew Suozzo a6ba2b9015
Fix indentation for get_stats_profile() docs (GH-23618)
The existing method is indented one too many times which
makes it look like a sub-method of print_callees().
2020-12-17 01:17:22 +02:00
Irit Katriel c590c2338e
bpo-23915: update and elucidate documentation of with_traceback (GH-23680) 2020-12-16 17:03:32 +01:00
Antoine fc3dca3e16
Clarify eval() doc from library/functions. (GH-22700) 2020-12-16 16:45:19 +01:00
Vladimir 3f9fe23c05
bpo-42179: Clarify exception chaining (GH-23160)
* Update errors.rst

Clarify exception chaining behaviour and give a reference to the library documentation.

* Update errors.rst

Wording

* Update errors.rst

Spelling

* Update errors.rst

Remove mentioning of special attributes as folks think it's too much for beginners.
2020-12-15 18:47:26 -08:00
Jason R. Coombs 928dbfc16c
bpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)
Automerge-Triggered-By: GH:jaraco
2020-12-15 18:12:54 -08:00
pxinwr e1e3c2dac3
bpo-31904: Disable os.popen and popen test cases on VxWorks (GH-21687) 2020-12-15 22:20:07 +01:00
Pablo Galindo 0911411e0c
Update stable ABI script for MacOS and update list of exported symbols (GH-23783) 2020-12-15 18:16:13 +00:00
Julien Palard c8a10d2fab
bpo-36675: Doc: Reveal doctest directives (GH-23620) 2020-12-15 17:23:03 +01:00
Victor Stinner 357704c9f2
bpo-42639: atexit now logs callbacks exceptions (GH-23771)
At Python exit, if a callback registered with atexit.register()
fails, its exception is now logged. Previously, only some exceptions
were logged, and the last exception was always silently ignored.

Add _PyAtExit_Call() function and remove
PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls
directly _PyAtExit_Call().

The atexit module must now always be built as a built-in module.
2020-12-14 23:07:54 +01:00
sblondon da431f789b
Add two spaces around equal sign (#23719)
Fit to PEP8 coding style
2020-12-12 21:27:22 -08:00
Nick Gaya 4b8cdfcb22
bpo-41879: Doc: Fix description of async for statement (GH-23548)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables.  This fix is relevant for version 3.7 onward.
2020-12-11 00:27:35 -08:00
Ethan Furman efb13be72c
bpo-42385: [Enum] add `_generate_next_value_` to StrEnum (GH-23735)
The default for auto() is to return an integer, which doesn't work for `StrEnum`.  The new `_generate_next_value_` for `StrEnum` returns the member name, lower cased.
2020-12-10 12:20:06 -08:00
vabr-g 9fc571359a
bpo-41877: Improve docs for assert misspellings check in mock (GH-23729)
This is a follow-up to
4662fa9bfe.
That original commit expanded guards against misspelling assertions on
mocks. This follow-up updates the documentation and improves the error
message by pointing out the potential cause and solution.

Automerge-Triggered-By: GH:gpshead
2020-12-10 10:35:28 -08:00
Ethan Furman 7cf0aad96d
bpo-42517: [Enum] do not convert private names into members (GH-23722)
private names, such as `_Color__hue` and `_Color__hue_` are now normal attributes, and do not become members nor raise exceptions
2020-12-09 17:12:11 -08:00
Andre Delfino 2a35137328
[doc] Link to issue regarding logging.disable level param default value (GH-23726) 2020-12-09 15:37:39 -08:00
Andre Delfino 35cacce525
[doc] Document logging.basicConfig default format (GH-23710)
Automerge-Triggered-By: GH:vsajip
2020-12-09 13:56:17 -08:00
Hai Shi 0f91f586ae
bpo-42599: Remove useless PyModule_GetWarningsModule() (GH-23691)
Removed PyModule_GetWarningsModule() which is useless due to 
the _warnings module was converted to a builtin module in 2.6.
2020-12-08 15:42:42 +01:00
Matěj Cepl b63a620014
bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)
The solution in gh#python/cpython#13236 is too strict because it
effectively requires the use of Sphinx >= 2.0. It is not too difficult to
make the same solution more robust so it works with all normal versions
of Sphinx.
2020-12-07 20:05:13 +00:00
Victor Stinner 0ef96c2b2a
bpo-30459: Cast the result of PyCell_SET to void (GH-23654) 2020-12-07 11:56:20 +01:00
Raymond Hettinger 752cdf21eb
bpo-38843: Document behavior of default when the attribute is already set (GH-23653) 2020-12-06 18:29:08 -08:00
Brett Cannon 2de5097ba4
bpo-26131: Deprecate usage of load_module() (GH-23469)
Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
2020-12-04 15:39:21 -08:00
Pablo Galindo 85f1dedb8d
bpo-42545: Check that all symbols in the limited ABI are exported (GH-23616) 2020-12-04 22:05:58 +00:00
Zackery Spytz db68544122
bpo-42523: Fix supported versions in "Using Python on Windows" (GH-23603) 2020-12-03 17:22:04 +00:00
Victor Stinner 1867b462de
bpo-37221: PyCode_New() didn't change in Python 3.8 (GH-23595) 2020-12-01 16:22:25 +01:00
Andre Delfino bc662c0bd7
[doc] Fix abc.update_abstractmethods markup (GH-23576)
Add link to ABCMeta while at it.
2020-12-01 01:45:11 -08:00
Andre Delfino 80a429eae9
Fix bz2 examples markup (#23580) 2020-12-01 10:41:12 +01:00
Raymond Hettinger cc061d0e6f
bpo-38200: Add itertools.pairwise() (GH-23549) 2020-11-30 20:42:54 -08:00
Christian Heimes 5c73afc36e
bpo-28468: Add platform.freedesktop_os_release() (GH-23492)
Add platform.freedesktop_os_release() function to parse freedesktop.org
os-release files.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2020-11-30 22:34:45 +01:00
James Gerity bcc9579227
bpo-42485: [Doc] Link to PEP 617 from full grammar specification (GH-23532)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-11-30 19:08:26 +00:00
Raymond Hettinger 7f82f22eba
bpo-42501: Revise the usage note for Enums with the choices (GH-23563) 2020-11-30 09:55:13 -08:00
Yasser A 9f004634a2
bpo-42451: Indicate that PyTuple_GetItem does not support negative indices (GH-23529) 2020-11-30 10:53:11 +01:00
Raymond Hettinger fc40b3020c
bpo-42450: Minor updates to the itertools recipes (GH-23555) 2020-11-29 10:47:22 -08:00
Yurii Karabas 86150d39c8
bpo-42392: Remove deprecated loop parameter from docs (GH-23552) 2020-11-29 14:50:57 +02:00
Mark Dickinson c642374b3e
bpo-39096: Improve description of 'e', 'f' and 'g' presentation types (#23537)
* Improve description of 'e', 'f' and 'g' presentation types

* Drop the 'E' from Scientific 'E' notation; remove >= 0 qualifications

* Fix false statement that the alternate form is valid for Decimal

* Nitpick: remove the Harvard/Oxford comma

* Add note that the decimal point is also removed if no digits follow it, except in alternate form
2020-11-29 09:34:36 +00:00
pxinwr a86a274b72
bpo-31904: add shell requirement for test_pipes (GH-23489)
VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.
2020-11-28 14:04:50 -08:00
Andre Delfino fa840cc81d
Fix dis markup (GH-23524) 2020-11-28 13:43:22 -08:00
Andre Delfino 4b44472966
Fix multiprocessing markup (GH-23525) 2020-11-28 13:42:23 -08:00
Zackery Spytz d41ec65ab7
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538) 2020-11-28 16:53:39 +02:00
Volker-Weissmann c8aaf71dde
bpo-17852: Doc: Fix the tutorial about closing files (GH-23135)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-11-27 09:41:32 +09:00
Shane Harvey a1652da2c8
Document optional 'task'/'asyncgen' fields in call_exception_handler (#21735) 2020-11-26 15:24:48 +02:00
basak 9d09e1719c
Typo: fix inverted sense of statement (GH-23288)
Looks like a "not" was inadvertently omitted in commit e6a7ea4.
Classmethods are useful when data stored in specific instances are *not*
needed.

Automerge-Triggered-By: GH:JulienPalard
2020-11-25 06:12:17 -08:00
Dong-hee Na be319c0c10
bpo-42299: Remove formatter module (GH-23476) 2020-11-25 22:17:30 +09:00
Yurii Karabas 7301979b23
bpo-42202: Store func annotations as a tuple (GH-23316)
Reduce memory footprint and improve performance of loading modules having many func annotations.

  >>> sys.getsizeof({"a":"int","b":"int","return":"int"})
  232
  >>> sys.getsizeof(("a","int","b","int","return","int"))
  88

The tuple is converted into dict on the fly when `func.__annotations__` is accessed first.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-11-25 19:43:18 +09:00
Raymond Hettinger 85c84920f5
Add more tests to the descriptor howto guide (GH-23506) 2020-11-25 01:54:24 -08:00
Julien Palard c9c6e9f89a
bpo-42238: Doc: Remove make suspicious from the CI and docs builds. (GH-23313)
It probably helped a lot a while back, but may not be as usefull
today.  We'll continue monitoring it before deletion, so true
positives can be migrated to rstlint.
2020-11-25 10:18:00 +01:00
kj 8d17d2bd0a
Doc: Minor fixes (GH-23422) 2020-11-25 13:59:59 +09:00
Raymond Hettinger 2d44a6bc4f
Add doctests to the descriptor HowTo (GH-23500) 2020-11-24 20:57:02 -08:00
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