Commit graph

122249 commits

Author SHA1 Message Date
Jacob Walls aee8f03abb
Fix version number in use_load_tests deprecation reference (GH-119151)
Deprecation took place in d78742a260 (3.5)
2024-05-22 12:43:56 +03:00
Xie Yanbo 904e256292
Fix typos in NEWS entries for 3.13 (GH-119374) 2024-05-22 12:31:37 +03:00
Mathijs Mortimer 5adf78f546
Clarify that dklen is expected in bytes for the hashlib functions (GH-106624) 2024-05-22 11:51:25 +03:00
Alyssa Coghlan 31d61a75c9
DOCS: fix error in exec namespace note (gh-119378)
When updating the new exec note added in gh-119235 as part of the
PEP 667 general docs PR, I suggested a workaround that isn't valid.

The first half of the note is still reasonable, so just omit the invalid text.
2024-05-22 06:38:06 +00:00
Aya Elsayed 5091c4400c
gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (#119355)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 07:56:35 +02:00
Pablo Galindo Salgado e6572e8f98
gh-111201: Speed up paste mode in the REPL (#119341)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 07:28:32 +02:00
Arnon Yaari cd516cd1f5
gh-111201: auto-indentation in _pyrepl (#119348)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 06:21:14 +02:00
Jelle Zijlstra e9875ecb5d
gh-119180: PEP 649: Add __annotate__ attributes (#119209) 2024-05-22 04:38:12 +02:00
Eugene Triguba 73ab83b27f
gh-119357: Increase test coverage for keymap in _pyrepl (#119358)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 04:36:01 +02:00
Lysandros Nikolaou c886bece3b
gh-111201: Add append to screen method to avoid recalculation (#119274)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 04:35:44 +02:00
Batuhan Taskaya d065edfb66
gh-60191: Implement ast.compare (#19211)
* bpo-15987: Implement ast.compare

Add a compare() function that compares two ASTs for structural equality. There are two set of attributes on AST node objects, fields and attributes. The fields are always compared, since they represent the actual structure of the code. The attributes can be optionally be included in the comparison. Attributes capture things like line numbers of column offsets, so comparing them involves test whether the layout of the program text is the same. Since whitespace seems inessential for comparing ASTs, the default is to compare fields but not attributes.

ASTs are just Python objects that can be modified in arbitrary ways. The API for ASTs is under-specified in the presence of user modifications to objects. The comparison respects modifications to fields and attributes, and to _fields and _attributes attributes. A user could create obviously malformed objects, and the code will probably fail with an AttributeError when that happens. (For example, adding "spam" to _fields but not adding a "spam" attribute to the object.) 

Co-authored-by: Jeremy Hylton <jeremy@alum.mit.edu>
2024-05-22 01:39:26 +00:00
Landon Wood 0e3c8cda1f
gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (#119330) 2024-05-22 01:15:40 +00:00
Jelle Zijlstra 98e855fcc1
gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-22 00:46:39 +00:00
Koudai Aono 506b1a3ff6
gh-119205: Fix autocompletion bug in new repl (#119229)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-21 23:22:21 +00:00
Pablo Galindo Salgado a3e4fec873
gh-118893: Evaluate all statements in the new REPL separately (#119318)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-21 23:16:56 +00:00
Brett Simmers 9fa206aaec
Docs: Add central references to free-threading-related options (#119017) 2024-05-21 17:49:23 -04:00
Irit Katriel 6e9863d7a3
gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (#119216) 2024-05-21 20:42:51 +00:00
Nice Zombies b64182550f
gh-118507 : Refactor nt._path_is* to improve applicability for other cases (GH-118755) 2024-05-21 21:36:36 +01:00
Victor Stinner de8f530841
gh-119102: Fix REPL for dumb terminal (#119332)
The site module gets the __main__ module to get _pyrepl.__main__.
2024-05-21 20:33:52 +00:00
Lysandros Nikolaou 561ff1fa71
gh-111201: Remove readline dependency from the PyREPL (#119262) 2024-05-21 22:30:45 +02:00
Josh Cannon e3ed574f6a
gh-90562: Mention slots pitfall in dataclass docs (#107391)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-21 19:37:32 +00:00
Serhiy Storchaka 10b1bd926a
gh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298) 2024-05-21 22:28:05 +03:00
Xie Yanbo b7f45a9332
Fix typos in documentation (#119295) 2024-05-21 18:35:05 +00:00
Victor Stinner f6da790122
gh-111389: Add PyHASH_MULTIPLIER constant (#119214) 2024-05-21 19:51:51 +02:00
Arnon Yaari 87939bd579
gh-117657: Fix itertools.count thread safety (#119268)
Fix itertools.count in free-threading mode
2024-05-21 10:16:34 -07:00
Irit Katriel 77ff28bb67
gh-109176: replace _PyFrame_OpAlreadyRan by an assertion that the frame is complete. (#119234) 2024-05-21 17:08:51 +00:00
Eugene Triguba f49df4f486
gh-119306: Break up _pyrepl tests (#119307) 2024-05-21 18:44:09 +02:00
Yan Yanchii e03dde5a24
gh-113978: Ignore warnings on text completion inside REPL (#113979) 2024-05-21 18:28:21 +02:00
Blaise Pabon 9db2fd7eda
GH-110383: Improve Tutorial for Input Ouput (#119230)
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-05-21 16:25:37 +00:00
Daniel Williams 62a29be5bb
gh-110383: Document socket.makefile() accepts combined modes (#119150)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
2024-05-21 16:23:50 +00:00
Alastair Stanley 0398d93392
gh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to new repl (#119248)
add word-skipping ctrl keybindings to new repl
2024-05-21 18:17:41 +02:00
Savannah Ostrowski c4722cd057
GH-119292: Add job to JIT CI to build and test with --disable-gil (GH-119293)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-21 11:00:52 -04:00
Donghee Na ab4263a82a
gh-119053: Implement the fast path for list.__getitem__ (gh-119112) 2024-05-21 09:49:18 -04:00
Victor Stinner 73f4a58d36
gh-119102: Fix REPL for dumb terminal (#119269)
Use CAN_USE_PYREPL of _pyrepl.__main__ in the site module to decide
if _pyrepl.write_history_file() can be used.
2024-05-21 13:53:20 +01:00
Nikita Sobolev b365332906
Use fail-fast: false in mypy.yml (#119297)
See docs about this setting: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
2024-05-21 07:52:43 -04:00
Alyssa Coghlan e870c852c0
gh-74929: PEP 667 general docs update (gh-119201)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
2024-05-21 03:32:15 +00:00
Wulian233 538ed5e481
gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (#119175)
------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-05-20 23:32:00 -04:00
Melanie Arbor 172690227e
gh-102136: Add -m to options that work with -i (GH-119271)
* GH-102136: Add -m to options that work with -i

* Linting
2024-05-20 19:38:33 -04:00
Alex Waygood 423bbcbbc4
gh-108267 Fix another dataclasses docs typo (#119277) 2024-05-20 22:34:57 +00:00
Lysandros Nikolaou fe921931a3
gh-111201: Add tests for unix console class in pyrepl (#118653) 2024-05-20 23:57:32 +02:00
Victor Stinner 9257731f5d
gh-119050: Add XML support to libregrtest refleak checker (#119148)
regrtest test runner: Add XML support to the refleak checker
(-R option).

* run_unittest() now stores XML elements as string, rather than
  objects, in support.junit_xml_list.
* runtest_refleak() now saves/restores XML strings before/after
  checking for reference leaks. Save XML into a temporary file.
2024-05-20 17:05:39 -04:00
Shantanu bf17986096
gh-119253: use ImportError in _ios_support (#119254) 2024-05-20 16:39:30 -04:00
Mark Jason Dominus (陶敏修) 8231a24454
gh-94808: Add test coverage for "starred kind" in _PyPegen_set_expr_context (GH-119222)
Add test coverage for "starred kind" in _PyPegen_set_expr_context
2024-05-20 20:29:17 +00:00
Shauna 7e57640c7e
gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (#119232)
* Remove description of issue fixed in 3.5 from autospeccing guide

* Make autospeccing note text more succint and lint whitespace

* Add linting changes (missed in last commit)

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-05-20 20:10:53 +00:00
Pablo Galindo Salgado a443e54281
gh-111201: Add more tests to test_pyrepl to cover key translation (#118705)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-20 22:04:52 +02:00
Serhiy Storchaka fe67af1963
gh-119189: Add more tests for mixed Fraction arithmetic (GH-119236) 2024-05-20 22:34:48 +03:00
Hugo van Kemenade 034cf0c316
Docs: Ensure no warnings are found in the NEWS file before a given line number (#119221) 2024-05-20 13:31:38 -06:00
Serhiy Storchaka e188527c34
gh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784)
It was set to 2 in 65f5e586a1 (GH-98592).
2024-05-20 22:21:04 +03:00
Tialo 6b80a5b20f
Use correct markup in unittest.mock.reset_mock documentation (GH-119207) 2024-05-20 21:17:44 +02:00
Toshio Kuratomi a6fdb31b67
gh-92081: Fix for email.generator.Generator with whitespace between encoded words. (#92281)
* Fix for email.generator.Generator with whitespace between encoded words.

email.generator.Generator currently does not handle whitespace between
encoded words correctly when the encoded words span multiple lines.  The
current generator will create an encoded word for each line.  If the end
of the line happens to correspond with the end real word in the
plaintext, the generator will place an unencoded space at the start of
the subsequent lines to represent the whitespace between the plaintext
words.

A compliant decoder will strip all the whitespace from between two
encoded words which leads to missing spaces in the round-tripped
output.

The fix for this is to make sure that whitespace between two encoded
words ends up inside of one or the other of the encoded words.  This
fix places the space inside of the second encoded word.

A second problem happens with continuation lines.  A continuation line that
starts with whitespace and is followed by a non-encoded word is fine because
the newline between such continuation lines is defined as condensing to
a single space character.  When the continuation line starts with whitespace
followed by an encoded word, however, the RFCs specify that the word is run
together with the encoded word on the previous line.  This is because normal
words are filded on syntactic breaks by encoded words are not.

The solution to this is to add the whitespace to the start of the encoded word
on the continuation line.

Test cases are from #92081

* Rename a variable so it's not confused with the final variable.
2024-05-20 19:10:47 +00:00