Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-119180: Use type descriptors to access annotations (PEP 749) #122074

Merged
merged 140 commits into from
Jul 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
985f8df
Add __annotate__ descriptors
JelleZijlstra May 20, 2024
c822ffa
fix refleaks
JelleZijlstra May 20, 2024
e80095e
blurb
JelleZijlstra May 20, 2024
90ff2c4
Fix some tests
JelleZijlstra May 20, 2024
026c0ff
regen globals
JelleZijlstra May 20, 2024
7968744
Some initial work
JelleZijlstra May 20, 2024
4e54197
Add bytecode for adding annotate
JelleZijlstra May 20, 2024
4469b32
compiler changes
JelleZijlstra May 20, 2024
47d672e
Functions work
JelleZijlstra May 21, 2024
ab9359c
Raise AssertionError on the wrong format
JelleZijlstra May 21, 2024
e65d55a
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 21, 2024
e50cd62
Modules and classes
JelleZijlstra May 21, 2024
afae5c0
attempts
JelleZijlstra May 21, 2024
e5a7b1a
Fixes
JelleZijlstra May 21, 2024
3f26d44
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 21, 2024
31a4471
Fix code object name
JelleZijlstra May 21, 2024
fbb1d88
Start fixing test_type_annotations
JelleZijlstra May 22, 2024
f452eb2
Fix class scoping
JelleZijlstra May 22, 2024
8c4b4e3
unyielding
JelleZijlstra May 22, 2024
cbf9a3d
Fix test_typing
JelleZijlstra May 22, 2024
5d182fc
Fix test_type_parmas
JelleZijlstra May 22, 2024
ce98c19
Add test, add to inspect
JelleZijlstra May 22, 2024
e0578fc
Use inspect constants
JelleZijlstra May 22, 2024
ed16167
test_grammar tweaks
JelleZijlstra May 22, 2024
f38de20
fix test_positional_only_arg
JelleZijlstra May 22, 2024
87baca2
Fix test_module
JelleZijlstra May 22, 2024
355d3df
Fix symtable tests
JelleZijlstra May 22, 2024
f9d81b6
fix test_pydoc
JelleZijlstra May 22, 2024
dd1f64a
fix test_traceback
JelleZijlstra May 22, 2024
62f5b3b
fix test_opcodes
JelleZijlstra May 22, 2024
c5b308b
Some work on inspect
JelleZijlstra May 22, 2024
b66ad8b
Merge branch 'main' into pep649-compile
JelleZijlstra May 22, 2024
1a63f5d
Raise NotImplementedError
JelleZijlstra May 22, 2024
82c0dbc
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 22, 2024
a0c39b5
blurb
JelleZijlstra May 22, 2024
083bbc5
Fix test_dis
JelleZijlstra May 22, 2024
de1b235
Remove broken tests
JelleZijlstra May 22, 2024
1c98fe5
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 24, 2024
5f5cf11
No deferred evaluation in interactive mode
JelleZijlstra May 24, 2024
77f3b1c
gh-119443: Turn off from __future__ import annotations in REPL
JelleZijlstra May 24, 2024
4217830
Fix refleak
JelleZijlstra May 24, 2024
13f5d76
Fix another refleak
JelleZijlstra May 24, 2024
a121e1a
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 24, 2024
242301c
Exit scope correctly on error
JelleZijlstra May 24, 2024
239ba23
fix test
JelleZijlstra May 24, 2024
f9b3956
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra May 24, 2024
787ad33
Update except
JelleZijlstra May 24, 2024
cfef2c6
Initialize field
JelleZijlstra May 25, 2024
b62e04c
Initialize field
JelleZijlstra May 25, 2024
c8a9294
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 25, 2024
5ae206d
self-review
JelleZijlstra May 25, 2024
24fd328
Fix crash found by CIFuzz
JelleZijlstra May 25, 2024
520b647
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra May 25, 2024
0f9d0c5
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 29, 2024
c181864
fix merge
JelleZijlstra May 29, 2024
0befff5
Name the function as __annotate__
JelleZijlstra May 29, 2024
ada6573
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 29, 2024
ae7714c
Replace find_ann()
JelleZijlstra May 29, 2024
431811a
fix test
JelleZijlstra May 29, 2024
7ca24d3
Remove second compiler pass
JelleZijlstra May 29, 2024
2ab5d07
Fix refleak
JelleZijlstra May 29, 2024
3b4a645
Fix a test
JelleZijlstra May 29, 2024
1dfd02b
Fix bug when there are only non-simple annotations
JelleZijlstra May 29, 2024
daba318
Fix more tests
JelleZijlstra May 29, 2024
0daf0b1
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 29, 2024
b066b3d
Remove REPL special case
JelleZijlstra May 29, 2024
7669361
no docstrings in the repl
JelleZijlstra May 29, 2024
f19060e
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra May 29, 2024
c6a1b80
Fix pyrepl test
JelleZijlstra May 29, 2024
5cdbdd7
CR feedback
JelleZijlstra May 30, 2024
636a636
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra May 31, 2024
26c731b
New annotations module
JelleZijlstra May 31, 2024
4d76723
run black on new modules
JelleZijlstra May 31, 2024
9a7e130
Some work
JelleZijlstra May 31, 2024
ed79b40
Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS
JelleZijlstra May 31, 2024
db67ef4
Merge branch 'lfcg' into pep649-inspect
JelleZijlstra May 31, 2024
d5b23ff
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra May 31, 2024
3e65032
Work on functools
JelleZijlstra May 31, 2024
e748feb
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra May 31, 2024
f0d430f
gh-119180: Lazily wrap annotations on classmethod and staticmethod
JelleZijlstra May 31, 2024
ad8c51c
Merge branch 'pep649-staticclassm' into pep649-inspect
JelleZijlstra May 31, 2024
c11cc6d
Use the new annotations module
JelleZijlstra May 31, 2024
a2b4f9e
Merge remote-tracking branch 'upstream/main' into pep649-compile
JelleZijlstra Jun 1, 2024
672511a
update_wrapper() updates __annotate__, not __annotations__
JelleZijlstra Jun 1, 2024
0f321c6
Expand test
JelleZijlstra Jun 1, 2024
178dd92
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 1, 2024
c64aa73
new stdlib module name
JelleZijlstra Jun 1, 2024
44d890e
More dataclass tests, fix get_annotations() bug
JelleZijlstra Jun 1, 2024
7c21c6a
Fix some bugs
JelleZijlstra Jun 1, 2024
bd469ab
Still generate __annotate__ if "from __future__ import annotations" i…
JelleZijlstra Jun 1, 2024
a2c2075
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra Jun 1, 2024
174aa47
Support for deferred evaluation of annotations in NamedTuple
JelleZijlstra Jun 1, 2024
cdcd8c8
Fix test
JelleZijlstra Jun 1, 2024
62ff51c
TypedDict
JelleZijlstra Jun 1, 2024
643b215
Move get_annotations tests
JelleZijlstra Jun 1, 2024
278de22
Regen globals
JelleZijlstra Jun 1, 2024
9215346
Fix test
JelleZijlstra Jun 1, 2024
9fa0ad7
Merge branch 'pep649-compile' into pep649-inspect
JelleZijlstra Jun 1, 2024
11a96f9
fix doctest
JelleZijlstra Jun 1, 2024
613710b
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 1, 2024
af5231c
evaluate_forward_ref()
JelleZijlstra Jun 1, 2024
e525f01
Finish get_annotations() and extend tests
JelleZijlstra Jun 1, 2024
eabea74
Test and fix stringifier
JelleZijlstra Jun 2, 2024
2dbe8ff
Closure support for SOURCE
JelleZijlstra Jun 2, 2024
2b88471
More stringifier fixes
JelleZijlstra Jun 2, 2024
406d3bc
del temporaries
JelleZijlstra Jun 2, 2024
ad91e5a
don't look
JelleZijlstra Jun 2, 2024
d9a6579
but why?
JelleZijlstra Jun 2, 2024
7c8bb1d
Update test_typing test
JelleZijlstra Jun 2, 2024
991798b
Reverse ops
JelleZijlstra Jun 2, 2024
0e609f8
Reformat new module
JelleZijlstra Jun 2, 2024
5f269c7
Remove unnecessary method
JelleZijlstra Jun 2, 2024
39f969c
Error on unrecognized format
JelleZijlstra Jun 2, 2024
8a21f29
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 2, 2024
223e2d5
Add some tests, and explicit errors for some unsupported operations
JelleZijlstra Jun 2, 2024
7afecca
I guess not
JelleZijlstra Jun 2, 2024
efce54f
Use __annotations__ directly for VALUE
JelleZijlstra Jun 2, 2024
487ea34
Merge branch 'main' into pep649-compile
JelleZijlstra Jun 7, 2024
06bf28a
Merge remote-tracking branch 'origin/pep649-compile' into pep649-inspect
JelleZijlstra Jun 7, 2024
3d5244e
annotationlib
JelleZijlstra Jun 7, 2024
09982e2
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 11, 2024
62ed45f
Add blurb
JelleZijlstra Jun 11, 2024
93a932d
Update functools
JelleZijlstra Jun 11, 2024
7586ed1
Update Lib/typing.py
JelleZijlstra Jun 11, 2024
064769a
Update Lib/annotationlib.py
JelleZijlstra Jun 11, 2024
6e078fd
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 13, 2024
c8510ea
Review feedback
JelleZijlstra Jun 13, 2024
9fd65bf
Add some tests
JelleZijlstra Jun 13, 2024
5ec025b
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jun 16, 2024
288fad9
unused imports
JelleZijlstra Jun 16, 2024
2e376e0
fix test_annotationlib
JelleZijlstra Jun 16, 2024
2a1c9a9
Fix tests
JelleZijlstra Jun 17, 2024
f60f435
Merge remote-tracking branch 'upstream/main' into pep649-inspect
JelleZijlstra Jul 21, 2024
1f3a63c
Reapply #120272
JelleZijlstra Jul 21, 2024
c87cccd
gh-119180: Yet another approach for fixing metaclass annotations
JelleZijlstra Jul 21, 2024
4a6f0b8
Merge branch 'main' into pep649-basedescriptor
JelleZijlstra Jul 23, 2024
0cae78f
Merge remote-tracking branch 'upstream/main' into pep649-basedescriptor
JelleZijlstra Jul 24, 2024
3eb222c
news
JelleZijlstra Jul 24, 2024
cb34d89
add a test
JelleZijlstra Jul 24, 2024
0c8bf2e
Add comment explaining why we get the type descriptors
JelleZijlstra Jul 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into pep649-basedescriptor
  • Loading branch information
JelleZijlstra committed Jul 24, 2024
commit 0cae78f453f60025ffd8d3eb449e0a821b7faa7f

This merge commit was added into this branch cleanly.

There are no new changes to show, but you can still view the diff.