Commit Graph

117893 Commits

Author SHA1 Message Date
Dong-hee Na 7513e2e7e4
gh-106751: Optimize KqueueSelector.select() for many iteration case (gh-106864) 2023-07-19 10:18:23 +09:00
Tian Gao 663854d73b
gh-106727: Make `inspect.getsource` smarter for class for same name definitions (#106815) 2023-07-18 23:20:31 +00:00
Erlend E. Aasland 505eede38d
Docs: Argument Clinic: Group guides about default values (#106872)
Previous ToC layout (excerpt):                                                                                          

    - How to use symbolic default values
    ...
    - How to assign default values to parameter
      - How to use the ``NULL`` default value
      - How to use expressions as default values

New layout:

    - How to assign default values to parameter
      - The ``NULL`` default value
      - Symbolic default values
      - Expressions as default values
2023-07-19 00:46:50 +02:00
Serhiy Storchaka a293fa5915
gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860) 2023-07-18 23:59:53 +03:00
Irit Katriel 40f3f11a77
gh-105481: Generate the opcode lists in dis from data extracted from bytecodes.c (#106758) 2023-07-18 19:42:44 +01:00
Victor Stinner 3535ef1eec
gh-106535: Document soft deprecations in What's New In Python 3.13 (#106859) 2023-07-18 17:13:51 +02:00
J. Nick Koston aecf6aca51
gh-106751: selectors: optimize EpollSelector.select() (#106754)
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2023-07-18 10:16:32 +00:00
Erlend E. Aasland 4cb0b9c0a9
Docs: Normalise Argument Clinic advanced topics headings (#106842)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-18 10:50:17 +02:00
Serhiy Storchaka 3e65baee72
gh-86493: Fix possible leaks in some modules initialization (GH-106768)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
2023-07-18 10:50:47 +03:00
Serhiy Storchaka 83ac128490
bpo-42327: C API: Add PyModule_Add() function (GH-23443)
It is a fixed implementation of PyModule_AddObject() which consistently
steals reference both on success and on failure.
2023-07-18 09:42:05 +03:00
Serhiy Storchaka 745492355b
gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) 2023-07-18 09:00:22 +03:00
Serhiy Storchaka e1c295e3da
gh-106719: Fix __annotations__ getter and setter in the type and module types (GH-106720)
No longer suppress arbitrary errors. Simplify the code.
2023-07-18 08:56:58 +03:00
Inada Naoki ece3b9d12a
gh-106843: fix memleak in _PyCompile_CleanDoc (#106846) 2023-07-18 03:44:16 +00:00
Guido van Rossum 1e36ca63f9
Small fixes to code generator (#106845)
These repair nits I found in PR gh-106798 (issue gh-106797) and in PR gh-106716 (issue gh-106706).
2023-07-18 01:30:41 +00:00
Erlend E. Aasland 00e52acebd
gh-104683: Argument Clinic: Modernise parse_special_symbol() (#106837)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 22:37:11 +00:00
Erlend E. Aasland 1654916c48
Add Erlend as CODEOWNER for Argument Clinic docs (#106840) 2023-07-17 22:10:03 +00:00
Erlend E. Aasland 22379c60ab
gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833) 2023-07-17 20:55:10 +00:00
Nikita Sobolev ebf2c56b33
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (#106832) 2023-07-17 19:55:40 +00:00
Guido van Rossum 8e9a1a0322
gh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794) 2023-07-17 12:12:33 -07:00
Mario Corchero 7e96370a94
gh-61215: threadingmock: Improve test suite to avoid race conditions (#106822)
threadingmock: Improve test suite to avoid race conditions

Simplify tests and split them into multiple tests to prevent assertions
from triggering race conditions.
Additionally, we rely on calling the mocks without delay to validate the
functionality of matching calls.
2023-07-17 18:57:40 +00:00
Guido van Rossum 2b94a05a0e
gh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)
By turning `assert(kwnames == NULL)` into a macro that is not in the "forbidden" list, many instructions that formerly were skipped because they contained such an assert (but no other mention of `kwnames`) are now supported in Tier 2. This covers 10 instructions in total (all specializations of `CALL` that invoke some C code):
- `CALL_NO_KW_TYPE_1`
- `CALL_NO_KW_STR_1`
- `CALL_NO_KW_TUPLE_1`
- `CALL_NO_KW_BUILTIN_O`
- `CALL_NO_KW_BUILTIN_FAST`
- `CALL_NO_KW_LEN`
- `CALL_NO_KW_ISINSTANCE`
- `CALL_NO_KW_METHOD_DESCRIPTOR_O`
- `CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS`
- `CALL_NO_KW_METHOD_DESCRIPTOR_FAST`
2023-07-17 11:02:58 -07:00
Guido van Rossum b2b261ab2a
gh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)
These aren't automatically translated because (ironically)
they are macros deferring to POP_JUMP_IF_{TRUE,FALSE},
which are not viable uops (being manually translated).

The hack is that we emit IS_NONE and then set opcode and
jump to the POP_JUMP_IF_{TRUE,FALSE} translation code.
2023-07-17 10:06:05 -07:00
Victor Stinner ad95c7253a
gh-106687: _ssl: use uint64_t for SSL options (#106700)
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html

Fix this compiler warning on Windows with MSC:

    conversion from 'uint64_t' to 'long', possible loss of data
2023-07-17 17:55:30 +02:00
Erlend E. Aasland 036bb73656
gh-104050: Improve Argument Clinic type annotation coverage (#106810)
Add various missing annotations in the following classes:
- BlockPrinter
- CConverter
- CLanguage
- FormatCounterFormatter
- Language
- _TextAccumulator

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 13:47:08 +02:00
Irit Katriel 5ecedbd266
gh-106789: avoid importing pprint from sysconfig (#106790) 2023-07-17 10:28:33 +01:00
Terry Jan Reedy 7aa89e505d
gh-106780: Add __match_args__ to tutorial example (#106784)
Add Point definition with this attribute before example
that needs it.
2023-07-16 23:36:03 -04:00
Raymond Hettinger babb22da5a
Add more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817) 2023-07-16 21:37:07 -05:00
Dong-hee Na 48956cc60e
gh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798) 2023-07-17 09:09:11 +09:00
Erlend E. Aasland 383dcbebcd
gh-104050: Argument Clinic: Annotate Clinic.parse() (#106760)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 00:04:10 +00:00
Nikita Sobolev c41320701b
gh-105540: Convert `pytest` tests of `cases_generator` to regular tests (#106713) 2023-07-16 16:05:24 -07:00
Jean-Baptiste Poupon 4dc593477a
Fix the french used in the email documentation (GH-106279)
* Fix the french used in the email documentation

The french used in one of the example was either machine translated a while ago or written by someone who does not speak french. Fixed it by using grammatically correct french.
2023-07-16 19:14:08 +02:00
Grigoriev Semyon 55408f86d7
gh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManager` (#106771)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-07-16 15:30:39 +00:00
Kevin Diem cc25ca16ee
gh-106706: Streamline family syntax in cases generator DSL (#106716)
From `family(opname, STRUCTSIZE) = OPNAME + SPEC1 + ... +  SPECn;`
to `family(OPNAME, STRUCTSIZE) = SPEC1 + ... + SPECn;`
2023-07-16 08:16:34 -07:00
Inada Naoki e58960160f
Doc: fix section levels of devmode doc (#106801) 2023-07-16 21:23:54 +09:00
Simone Rubino 83bd568d2b
Doc: devmode: add -Xdev option to example (#106253) 2023-07-16 16:29:58 +09:00
Hugo van Kemenade c02ee45031
Docs search: Replace jQuery with vanilla JavaScript (#106743)
* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'
2023-07-16 10:26:26 +03:00
Erlend E. Aasland 8c17729489
Docs: Normalize Argument Clinic How-To section capitalization (#106788) 2023-07-16 00:42:58 +02:00
Mathieu Dupuy d46a42fd8e
faq/library: remove outdated section (#105996) 2023-07-15 13:23:10 -07:00
Raymond Hettinger e2ec0bad67
Add more examples to the recipe docs (GH-106782)
Demonstrate that factor() works for large composites and large primes.
2023-07-15 14:43:09 -05:00
Jason R. Coombs 22980dc7c9
gh-106752: Sync with zipp 3.16.2 (#106757)
* gh-106752: Sync with zipp 3.16.2

* Add blurb
2023-07-15 09:21:17 -04:00
Inada Naoki 2566b74b26
gh-81283: compiler: remove indent from docstring (#106411)
Co-authored-by: Éric <merwok@netwok.org>
2023-07-15 19:33:32 +09:00
Erlend E. Aasland bbf6297985
gh-104050: Argument Clinic: Annotate BlockParser (#106750) 2023-07-15 10:11:32 +00:00
Erlend E. Aasland 2d7d1aa4bc
gh-106368: Increase Argument Clinic BlockParser test coverage (#106759) 2023-07-15 11:28:57 +02:00
Guido van Rossum 0db85eeba7
gh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)
The Tier 2 opcode _IS_ITER_EXHAUSTED_LIST (and _TUPLE)
didn't set it->it_seq to NULL, causing a subtle bug
that resulted in test_exhausted_iterator in list_tests.py
to fail when running all tests with -Xuops.

The bug was introduced in gh-106696.

Added this as an explicit test.

Also fixed the dependencies for ceval.o -- it depends on executor_cases.c.h.
2023-07-14 17:22:06 -07:00
Jason R. Coombs 03185f0c15
gh-106752: Move zipfile._path into its own package (#106753)
* gh-106752: Move zipfile._path into its own package so it may have supplementary behavior.

* Add blurb
2023-07-14 20:40:46 +00:00
Irit Katriel fb32f35c05
gh-102799: replace internal sys.exc_info() call by sys.exception() (#106746) 2023-07-14 20:41:24 +01:00
Alex Waygood 89ec0e9529
gh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently planned (#106748) 2023-07-14 19:49:02 +01:00
J. Nick Koston aeef8591e4
gh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` (#106555) 2023-07-15 03:46:30 +09:00
Irit Katriel 6a70edf24c
gh-105481: expose opcode metadata via the _opcode module (#106688) 2023-07-14 18:41:52 +01:00
Jason R. Coombs 243fdcb40e
gh-106531: Remove importlib.resources._legacy (#106532)
* gh-106531: Remove importlib.resources._legacy

Syncs with importlib_resources 6.0.

* Remove documentation for removed functionality.
2023-07-14 13:38:28 -04:00