summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-106320: Remove private _PyImport C API functions (#106383)Victor Stinner2023-07-038-22/+46
| | | | | | * Remove private _PyImport C API functions: move them to the internal C API (pycore_import.h). * No longer export most of these private functions. * _testcapi avoids private _PyImport_GetModuleAttrString().
* gh-86085: Remove _PyCodec_Forget() declaration (#106377)Victor Stinner2023-07-031-2/+0
| | | | The code was already removed by: commit c9f696cb96d1c362d5cad871f61da520572d9b08.
* gh-106320: Remove more private _PyUnicode C API functions (#106382)Victor Stinner2023-07-033-70/+70
| | | | | | Remove more private _PyUnicode C API functions: move them to the internal C API (pycore_unicodeobject.h). No longer export most pycore_unicodeobject.h functions.
* gh-104050: Annotate more Argument Clinic DSLParser state methods (#106376)Erlend E. Aasland2023-07-031-9/+19
| | | | | | | | Annotate the following methods: - state_parameter() - state_parameter_docstring_start() Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-106368: Clean up Argument Clinic tests (#106373)Erlend E. Aasland2023-07-031-356/+440
|
* gh-104683: Modernise Argument Clinic parameter state machine (#106362)Erlend E. Aasland2023-07-031-51/+78
| | | | | Use enums and pattern matching to make the code more readable. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Small speed-up for the convolve() recipe. (GH-106371)Raymond Hettinger2023-07-031-2/+2
|
* GH-106330: Fix matching of empty path in `pathlib.PurePath.match()` (GH-106331)Barney Gale2023-07-033-2/+12
| | | | | We match paths using the `_lines` attribute, which is derived from the path's string representation. The bug arises because an empty path's string representation is `'.'` (not `''`), which is matched by the `'*'` wildcard.
* GH-104584: Fix ENTER_EXECUTOR (GH-106141)Mark Shannon2023-07-038-269/+272
| | | | | | * Check eval-breaker in ENTER_EXECUTOR. * Make sure that frame->prev_instr is set before entering executor.
* gh-106368: Increase Argument Clinic test coverage (#106369)Erlend E. Aasland2023-07-031-0/+57
| | | Add tests for 'self' and 'defining_class' converter requirements.
* gh-106078: Move `context template` to decimal module global state (#106346)Charlie Zhao2023-07-032-32/+30
|
* gh-106290: Fix edge cases around uops (#106319)Guido van Rossum2023-07-037-234/+274
| | | | | | | | | | - Tweak uops debugging output - Fix the bug from gh-106290 - Rename `SET_IP` to `SAVE_IP` (per https://github.com/faster-cpython/ideas/issues/558) - Add a `SAVE_IP` uop at the start of the trace (ditto) - Allow `unbound_local_error`; this gives us uops for `LOAD_FAST_CHECK`, `LOAD_CLOSURE`, and `DELETE_FAST` - Longer traces - Support `STORE_FAST_LOAD_FAST`, `STORE_FAST_STORE_FAST` - Add deps on pycore_uops.h to Makefile(.pre.in)
* gh-91053: make func watcher tests resilient to other func watchers (#106286)Carl Meyer2023-07-031-12/+11
|
* gh-104050: Add more type hints to Argument Clinic DSLParser() (#106354)Erlend E. Aasland2023-07-031-8/+11
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-106359: Fix corner case bugs in Argument Clinic converter parser (#106361)Erlend E. Aasland2023-07-033-7/+27
| | | | | DSLParser.parse_converter() could return unusable kwdicts in some rare cases Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104146: Remove unused attr 'parameter_indent' from clinic.DLParser (#106358)Erlend E. Aasland2023-07-031-1/+0
|
* gh-106320: Remove private _PyErr C API functions (#106356)Victor Stinner2023-07-039-46/+63
| | | | Remove private _PyErr C API functions: move them to the internal C API (pycore_pyerrors.h).
* gh-104050: Annotate Argument Clinic DSLParser attributes (#106357)Erlend E. Aasland2023-07-031-1/+14
|
* gh-106320: Create pycore_modsupport.h header file (#106355)Victor Stinner2023-07-0320-18/+56
| | | | | | | | | | Remove the following functions from the C API, move them to the internal C API: add a new pycore_modsupport.h internal header file: * PyModule_CreateInitialized() * _PyArg_NoKwnames() * _Py_VaBuildStack() No longer export these functions.
* gh-106320: Move _PyUnicodeWriter to the internal C API (#106342)Victor Stinner2023-07-038-144/+166
| | | | | | Move also _PyUnicode_FormatAdvancedWriter(). CJK codecs and multibytecodec.c now define the Py_BUILD_CORE_MODULE macro.
* gh-61215: New mock to wait for multi-threaded events to happen (#16094)Mario Corchero2023-07-034-0/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mock: Add `ThreadingMock` class Add a new class that allows to wait for a call to happen by using `Event` objects. This mock class can be used to test and validate expectations of multithreading code. It uses two attributes for events to distinguish calls with any argument and calls with specific arguments. The calls with specific arguments need a lock to prevent two calls in parallel from creating the same event twice. The timeout is configured at class and constructor level to allow users to set a timeout, we considered passing it as an argument to the function but it could collide with a function parameter. Alternatively we also considered passing it as positional only but from an API caller perspective it was unclear what the first number meant on the function call, think `mock.wait_until_called(1, "arg1", "arg2")`, where 1 is the timeout. Lastly we also considered adding the new attributes to magic mock directly rather than having a custom mock class for multi threading scenarios, but we preferred to have specialised class that can be composed if necessary. Additionally, having added it to `MagicMock` directly would have resulted in `AsyncMock` having this logic, which would not work as expected, since when if user "waits" on a coroutine does not have the same meaning as waiting on a standard call. Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
* Document PYTHONSAFEPATH along side -P (#106122)Jeremy Paige2023-07-031-2/+2
|
* Replace the esoteric term 'datum' when describing dict comprehensions (#106119)Ned Batchelder2023-07-032-12/+12
|
* gh-104050: Add more type hints to Argument Clinic DSLParser() (#106343)Erlend E. Aasland2023-07-021-11/+22
| | | | | | | | | | Annotate the following method signatures: - state_dsl_start() - state_parameter_docstring_start() - state_parameters_start() Inverting ignore_line() logic, add type hints (including type guard) to it, and rename to valid_line().
* gh-106320: _testcapi avoids private _PyUnicode_EqualToASCIIString() (#106341)Victor Stinner2023-07-021-1/+1
| | | | Replace private _PyUnicode_EqualToASCIIString() with public PyUnicode_CompareWithASCIIString().
* gh-106320: Add pycore_complexobject.h header file (#106339)Victor Stinner2023-07-028-21/+41
| | | | | | Add internal pycore_complexobject.h header file. Move _Py_c_xxx() functions and _PyComplex_FormatAdvancedWriter() function to this new header file.
* gh-106078: Move DecimalException to _decimal state (#106301)Charlie Zhao2023-07-022-9/+9
|
* gh-106320: Use _PyInterpreterState_GET() (#106336)Victor Stinner2023-07-0211-35/+34
| | | | Replace PyInterpreterState_Get() with inlined _PyInterpreterState_GET().
* gh-106320: Remove private _PyInterpreterState functions (#106335)Victor Stinner2023-07-020-0/+0
| | | | | | | | | Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API.
* gh-104922: Doc: add note about PY_SSIZE_T_CLEAN (#106314)Inada Naoki2023-07-022-2/+11
| | | Add note about PY_SSIZE_T_CLEAN in extending and embedding document.
* gh-106217: Truncate the issue body size of `new-bugs-announce-notifier` ↵Nikita Sobolev2023-07-021-1/+4
| | | | | | (#106329) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-104922: remove PY_SSIZE_T_CLEAN (#106315)Inada Naoki2023-07-0264-90/+0
|
* gh-106320: Remove private _PyInterpreterState functions (#106325)Victor Stinner2023-07-029-70/+86
| | | | | | | | | Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API.
* gh-106320: Remove private _PyTraceMalloc C API functions (#106324)Victor Stinner2023-07-0210-98/+99
| | | | | | | * Remove private _PyTraceMalloc C API functions: move them to the internal C API. * Don't export most of these functions anymore, but still export _PyTraceMalloc_GetTraceback() used by tests. * Rename Include/tracemalloc.h to Include/cpython/tracemalloc.h
* gh-106320: Remove _PyInterpreterState_Get() alias (#106321)Victor Stinner2023-07-0111-22/+29
| | | | Replace calls to the (removed) slow _PyInterpreterState_Get() with fast inlined _PyInterpreterState_GET() function.
* gh-102541: Fix Helper.help("mod") for non-existent mod (#105934)Kirill Podoprigora2023-07-013-1/+13
| | | | | | If the output arg to Helper() is a stream rather than the default None, which means 'page to stdout', the ImportError from pydoc.resolve is currently not caught in pydoc.doc. The same error is caught when output is None. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-106316: Remove pytime.h header file (#106317)Victor Stinner2023-07-0125-667/+650
| | | | | | | | | | | | | | | | | Remove the "cpython/pytime.h" header file: it only contained private functions. Move functions to the internal pycore_time.h header file. Move tests from _testcapi to _testinternalcapi. Rename also test methods to have the same name than tested C functions. No longer export these functions: * _PyTime_Add() * _PyTime_As100Nanoseconds() * _PyTime_FromMicrosecondsClamp() * _PyTime_FromTimespec() * _PyTime_FromTimeval() * _PyTime_GetPerfCounterWithInfo() * _PyTime_MulDiv()
* Fix duplicate word typos in comments (#106225)Md Sadman Chowdhury2023-07-013-3/+3
|
* GH-89812: Improve test for `pathlib.Path.stat()` (GH-106064)Barney Gale2023-07-011-8/+18
| | | | | Make assertions about the `st_mode`, `st_ino` and `st_dev` attributes of the stat results from two files and a directory, rather than checking if `chmod()` affects `st_mode` (which is already tested elsewhere).
* GH-89812: Miscellaneous pathlib test improvements (GH-106063)Barney Gale2023-07-011-18/+17
| | | | | | | - Split out dedicated test for unbuffered `open()` - Split out dedicated test for `is_mount()` at the filesystem root - Avoid `os.stat()` when checking that empty paths point to '.' - Remove unnecessary `rmtree()` call - Remove unused `assertSame()` method
* GH-89812: Test that `pathlib.Path.is_junction()` returns false (GH-106062)Barney Gale2023-07-011-0/+9
| | | | Slightly expand the test coverage of `is_junction()`. The existing test only checks that `os.path.isjunction()` is called under-the-hood.
* GH-89812: Make symlink support configurable in pathlib tests. (GH-106060)Barney Gale2023-07-011-36/+52
| | | | | | | Adjust the pathlib tests to add a new `PathTest.can_symlink` class attribute, which allows us to enable or disable symlink support in tests. A (near-)future commit will add an `AbstractPath` class; its tests will hard-code the value to `True` or `False` depending on a stub subclass's capabilities.
* gh-106149: move unconditional jump direction resolution from optimizer to ↵Irit Katriel2023-07-014-20/+44
| | | | assembler (#106291)
* build(deps): bump mheap/github-action-required-labels from 4 to 5 (#106306)dependabot[bot]2023-07-011-1/+1
| | | | | | | | | | | | | | | Bumps [mheap/github-action-required-labels](https://github.com/mheap/github-action-required-labels) from 4 to 5. - [Release notes](https://github.com/mheap/github-action-required-labels/releases) - [Commits](https://github.com/mheap/github-action-required-labels/compare/v4...v5) --- updated-dependencies: - dependency-name: mheap/github-action-required-labels dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): bump mypy from 1.3.0 to 1.4.1 in /Tools/clinic (#106305)dependabot[bot]2023-07-011-1/+1
| | | | | | | | | | | | | | Bumps [mypy](https://github.com/python/mypy) from 1.3.0 to 1.4.1. - [Commits](https://github.com/python/mypy/compare/v1.3.0...v1.4.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* gh-106232: Make timeit doc command lines compatible with Windows. (#106296)Terry Jan Reedy2023-07-013-10/+12
| | | | | | Command Prompt (CMD Shell) and older versions of PowerShell require double quotes and single quotes inside the string. This form also works on linux and macOS.
* gh-105486: Change the `repr` of `ParamSpec` list of args in `GenericAlias` ↵Nikita Sobolev2023-07-014-1/+62
| | | | (#105488)
* GH-89812: Simplify creation of symlinks in pathlib tests. (GH-106061)Barney Gale2023-06-301-20/+12
| | | | | | Remove `PathTest.dirlink()` function. Symlinks in `PathTest.setUp()` are created using `os.symlink()` directly; symlinks in test functions use `Path.symlink_to()` in order to make the tests applicable to a (near-)future `AbstractPath` class.
* gh-106145: Make `end_{lineno,col_offset}` required on `type_param` nodes ↵Nikita Sobolev2023-06-304-14/+10
| | | | (#106224)
* GH-106135: Add more edge-"cases" to test_patma (GH-106271)Nikita Sobolev2023-06-301-0/+131
|