Commit Graph

117147 Commits

Author SHA1 Message Date
Pablo Galindo Salgado ff7f731632
gh-104658: Fix location of unclosed quote error for multiline f-strings (#104660) 2023-05-20 14:07:05 +01:00
Alex Waygood 663c049ff7
gh-104683: Modernise `clinic.py` using `str.removeprefix` and `str.removesuffix` (#104685)
Both methods were new in Python 3.9.
2023-05-20 11:08:28 +00:00
Erlend E. Aasland ae147d01a0
gh-104146: Purge dead code from Argument Clinic (#104680)
The following local variables were assigned but never used:

- line 551:  result
- line 1341: groups
- line 1431: default_return_converter
- line 1529: ignore_self
- line 1809: input_checksum
- line 4224: new'

---

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-20 10:52:32 +00:00
Alex Waygood 02b60035ce
gh-104683: Argument clinic: use `dict` over `OrderedDict` (#104647)
For code readability. Instances of `builtins.dict` have been ordered since 3.6, and have been guaranteed by the language to be ordered since Python 3.7. Argument Clinic now requires Python 3.10+.
2023-05-20 11:24:00 +01:00
partev 06eeee97e3
Replace "OS X" with "macOS" (#104653) 2023-05-20 01:25:52 -07:00
Prince Roshan ceaa4c3476
gh-103987: fix several crashes in mmap module (#103990)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-19 20:34:12 -07:00
Nyakku Shigure 3bc94e678f
docs: fix wrong indentation causing rendering error in dis page (#104661) 2023-05-19 23:11:21 +03:00
Matthias Görgens 6e39fa1955
gh-94906: Support multiple steps in math.nextafter (#103881)
This PR updates `math.nextafter` to add a new `steps` argument. The behaviour is as though `math.nextafter` had been called `steps` times in succession.

---------

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2023-05-19 21:03:49 +01:00
chgnrdv c3f43bfb4b
gh-104472: Skip `test_subprocess.ProcessTestCase.test_empty_env` if ASAN is enabled (#104667)
Skip test_subprocess.ProcessTestCase.test_empty_env if ASAN is enabled.
2023-05-19 19:25:51 +00:00
Christopher Chavez 625887e6df
gh-103839: Allow building Tkinter against Tcl 8.7 without external libtommath (GH-103842) 2023-05-19 15:09:59 -04:00
Soumendra Ganguly 486bc8e030
gh-85984: New additions and improvements to the tty library. (#101832)
New additions to the tty library. Functions added: cfmakeraw(), and cfmakecbreak(). The
functions setcbreak() and setraw() now return original termios to save an extra tcgetattr() call.

---------

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-05-19 18:13:30 +00:00
Thomas Hisch 3ac856e697
gh-104659: Consolidate python examples in enum documentation (#104665) 2023-05-19 11:46:20 -06:00
Nikita Sobolev 27a7d5e1cd
gh-92248: Deprecate `type`, `choices`, `metavar` parameters of `argparse.BooleanOptionalAction` (#103678)
Co-authored-by: Kirill <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-19 16:44:43 +00:00
Irit Katriel ac56a854b4
gh-104645: fix error handling in marshal tests (#104646) 2023-05-19 17:23:57 +01:00
Jelle Zijlstra 8f1f3b9abd
gh-104600: Make type.__type_params__ writable (#104634)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-19 09:04:47 -07:00
Jelle Zijlstra dbe171e609
gh-104602: Add additional test for listcomp with lambda (#104639)
This threw a SystemError before #104603. Adding a separate test
because this was a different failure mode than the other two new
tests from #104603, both of which used to segfault.
2023-05-19 09:16:39 -06:00
Jelle Zijlstra 8a8853af24
gh-104640: Disallow walrus in comprehension within type scopes (#104641) 2023-05-19 07:31:09 -07:00
Jelle Zijlstra ab8f54668b
gh-103921: Rename "type" header in argparse docs (#104654)
This allows :keyword:`type` to link to docs for the new `type`
statement (being written in gh-104642) instead of to this header
in the argparse docs.
2023-05-19 06:50:34 -07:00
Alex Waygood a412fc58cc
Improve readability of `typing._ProtocolMeta.__instancecheck__` (#104649) 2023-05-19 14:30:02 +01:00
Youfu Zhang 9c5aa8967b
gh-96522: Fix deadlock in pty.spawn (#96639) 2023-05-19 13:22:43 +00:00
Mark Shannon c26d03d5d6
GH-102818: Do not call `PyTraceBack_Here` in sys.settrace trampoline. (GH-104579) 2023-05-19 12:40:48 +01:00
Ronald Oussoren 616fcad6e2
GH-103545: Add macOS specific constants for ``os.setpriority`` to ``os`` (#104606)
This adds a number of PRIO_DARWIN_* constants to the os module for use with os.setpriority.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-05-19 09:15:11 +02:00
Erlend E. Aasland fd04bfeaf7
gh-104623: Update macOS installer to SQLite 3.42.0 (GH-104624) 2023-05-19 02:52:24 -04:00
Carl Meyer 70c7796477
gh-104619: never leak comprehension locals to outer locals() (#104637) 2023-05-18 18:50:24 -07:00
Carl Meyer 86e6f16ccb
gh-104602: ensure all cellvars are known up front (#104603)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-19 00:07:35 +00:00
Jelle Zijlstra 3fadd7d585
gh-104600: Make function.__type_params__ writable (#104601) 2023-05-18 16:45:37 -07:00
Alex Waygood f7835fc7e9
gh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols (#104622)
Don't set special protocol attributes on non-protocol subclasses of protocols
2023-05-19 00:34:40 +01:00
Erlend E. Aasland aab2a366b7
gh-104623: Update Windows installer to use SQLite 3.42.0 (#104625) 2023-05-19 00:59:40 +02:00
Erlend E. Aasland 94c8edabd3
gh-104050: Add more type annotations to Argument Clinic (#104628)
Annotate the following:

- methods of class Class
- methods of class Module
- methods of class PythonParser
- function compute_checksum()
- function parse_file()
- global variable unsupported_special_methods
2023-05-18 22:57:26 +00:00
Erlend E. Aasland 86ee49f469
gh-104629: Don't skip test_clinic if _testclinic is missing (#104630)
Just skip the tests that depend on the _testclinic extension module;
we can still run the Python tests.
2023-05-19 00:56:34 +02:00
Jelle Zijlstra b9dce3aec4
gh-104549: Set __module__ on TypeAliasType (#104550) 2023-05-18 15:56:15 -07:00
Alex Waygood 1c55e8d007
gh-104050: Improve some typing around `default`s and sentinel values (#104626)
- Convert `unspecified` and `unknown` to be members of a `Sentinels` enum, rather than instances of bespoke classes.
  - An enum feels more idiomatic here, and works better with type checkers.
  - Convert some `==` and `!=` checks for these values to identity checks, which are more idiomatic with sentinels.
  - _Don't_ do the same for `Null`, as this needs to be a distinct type due to its usage in `clinic.py`.
- Use `object` as the annotation for `default` across `clinic.py`. `default` can be literally any object, so `object` is the correct annotation here.

---

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-18 21:58:42 +00:00
Erlend E. Aasland 61027c0211
gh-104146: Remove unused vars from Argument Clinic (#104627)
Remove 'in_classes' and 'so_far' from DSLParser.directive_module()
2023-05-18 21:52:59 +00:00
Carl Meyer 0589c6a4d3
gh-104615: don't make unsafe swaps in apply_static_swaps (#104620) 2023-05-18 21:22:03 +00:00
thirumurugan dcdc90d384
GH-104484: Add case_sensitive argument to `pathlib.PurePath.match()` (GH-104565)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-05-18 18:59:31 +01:00
Mark Shannon cfa517d5a6
GH-96803: Document and test new unstable internal frame API functions (GH-104211)
Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.
2023-05-18 10:10:15 +01:00
Mark Shannon 68b5f08b72
GH-104580: Don't cache eval breaker in interpreter (GH-104581)
Move eval-breaker to the front of the interpreter state.
2023-05-18 10:08:33 +01:00
Jelle Zijlstra 662aede68b
gh-104374: Remove access to class scopes for inlined comprehensions (#104528)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-18 05:22:17 +00:00
Prince Roshan 152227b569
gh-103606: Improve error message from logging.config.FileConfig (GH-103628) 2023-05-18 05:20:47 +01:00
Terry Jan Reedy c5b670efd1
gh-104499: Fix typo. (#104598) 2023-05-18 02:35:46 +00:00
Terry Jan Reedy 678bf57ed0
gh-104499: IDLE - fix completions for tk aqua 8.7 (#104591) 2023-05-17 21:36:58 -04:00
Guido van Rossum 7fc8e2d462
gh-104340: Suppress warning about unawaited exception for closed pipe stdin (#104586) 2023-05-17 16:45:11 -07:00
Alex Waygood b27fe67f3c
gh-104555: Runtime-checkable protocols: Don't let previous calls to `isinstance()` influence whether `issubclass()` raises an exception (#104559)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-17 23:43:12 +00:00
Erlend E. Aasland 2f369cafee
gh-104050: Add type hints to Argument Clinic converter keywords (#104588)
Introduce TypeSet, and use it to annotate the 'accept' keyword of
various C converters. Also add some missing return annotations for
converter init functions.
2023-05-17 21:05:22 +00:00
Terry Jan Reedy aed643baa9
gh-104496: IDLE - fix About for mixed tcl/tk versions (#104585)
Print both if they are different, as may happen in the future.
2023-05-17 15:59:13 -04:00
Gregory P. Smith c649df63e0
gh-104372: Cleanup _posixsubprocess `make_inheritable` for async signal safety and no GIL requirement (#104518)
Move all of the Python C API calls into the parent process up front
instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from
the post-fork/vfork child process.

Much of this was long overdue. We shouldn't have been using PyTuple and
PyLong APIs within all of these low level functions anyways.
2023-05-17 08:59:45 -07:00
Mark Shannon f7df173949
GH-101520: Move tracemalloc functionality into core, leaving interface in Modules. (#104508) 2023-05-17 14:17:16 +01:00
Jelle Zijlstra 26931944dd
typing: Add more tests for TypeVar (#104571)
During the PEP 695 implementation at one point I made
TypeVar.__name__ return garbage, and all of test_typing passed.
So I decided to add a few more tests. In the process I discovered
a minor incompatibility from the C implementation of TypeVar:
empty constraints were returned as None instead of an empty tuple.
2023-05-17 06:08:21 -07:00
Jelle Zijlstra 97db2f3e07
gh-104572: Improve error messages for invalid constructs in PEP 695 contexts (#104573) 2023-05-17 06:05:42 -07:00
Jelle Zijlstra 0cb2fdc621
typing: Use PEP 695 syntax in typing.py (#104553)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-17 06:03:58 -07:00