Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-103763: Implement PEP 695 #103764
gh-103763: Implement PEP 695 #103764
Changes from 110 commits
9c8cd71
609ac0d
7a5e457
1e0b74c
2a5023a
1bc8574
ed42796
d06f43d
830b36a
b6bf2bc
6bb4795
c7c1618
772920f
6ff6f5a
9fdf373
f7c513d
1d7b035
85a4409
55d0fd9
618e173
bef978f
3cd026a
b12663d
bb9c43c
037ddfa
a62f0c2
9c7a153
aa8ea68
ab6b718
dba4293
e36c5f5
21e1b1a
8505134
338b978
04bc911
521bd81
f2d91b0
ccf68d9
6159d75
d9c0d90
d26b82a
423d2de
fdd8877
2461ed5
e9a196f
536cf13
c0b04e3
59e6fa0
5521c7d
b9d8fbb
f3340c2
b5de372
fa81c01
7aeee08
a7e6bcb
fe84458
34c024d
d9ec56e
6ab8b1e
d916974
b38dea4
8991bb1
c3f520a
e668ed8
2b844f4
47d24d9
8ad0b5b
6312d7b
48e23b0
dec31ae
062999c
9147a4a
1b043c8
16cb6a5
1bdfb75
308c7c1
ff22d22
c4ce394
f02199f
3fe019b
737d96a
6fe9476
80a9efb
21b3aec
30487a5
1575c66
a6045f0
2c8b4f1
66851e6
be059c1
ac7f722
0f70925
e17c3b0
45696ae
02e0a8a
7a8fc14
7195162
5fbd4d5
f86be9c
77b3807
f448248
d32bc61
27a8a4c
44b9222
445a39b
7fa37b4
880f066
3d8e24e
74c1a0d
d5b86c5
3b6098d
9632c02
8a0ecb7
0bb175a
5e4ec0e
12d3004
6c3f65a
84a00ce
e0acb87
d77c4fb
ea66c7c
b314a3f
2e913ca
394d128
bd49622
bf45a8e
ce7fe9c
e5a6c21
96324a5
fd0f7b4
e784da1
72fc40c
4b6a815
93a4552
b36b7af
a85fb6c
6454026
21667d9
e65d668
e0a0b04
d5c44f5
ce6a990
2fc9cc7
3f71911
0891a61
78a9ba2
c0b45e1
16a037f
c5d9378
0399ed4
782fc35
a092896
0241da5
5b3a204
78f3f4b
9d3177b
c52179c
d0fa718
f0936de
5259096
c3d6464
f580583
17c8060
f4ea500
43bcd02
827b9e5
71cef78
80ffbf3
e786382
2a8f0ef
967f100
4cbbd24
8dfb93d
43f0270
0b35c6c
a2f3c75
c51b9fc
047abba
51a4655
5e68cd8
3b63b76
281f575
a3cd2e7
a4f6076
88ac5dc
32fc89c
02f1fca
249ca43
645b08b
17c30f6
0067e00
39ace71
a1c59f7
f7e6219
8f54b02
bb2df61
fdf65ad
4fecf7d
f8406ce
fd4fe5c
0b94580
e952d61
785dd45
be70e3c
92c29e7
529c74d
531fcf7
497e22a
bfb5ac0
a1be61d
1e9273c
bc37579
3817ab4
f2a9393
4f1223e
d490251
33f4c12
b9f4540
a64922f
8a783b3
9e6658a
0aad1f4
a22a08f
1328c75
7d6016e
1401209
e049f5a
c4d9ec4
b93f85e
f412f49
d4e72a5
08d931c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all these classes stored on the interpreter?
Can't they be made static and shareable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic needs to be used with multiple inheritance; when I used it with static types that didn't work. If you feel strongly that we need static types I can try again.
Also, thanks for the review! I'll probably not have time to push code changes until tonight, but will post some replies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is unfortunate. I do think they should be static classes.
However, if we need to fix how inheritance is implemented first, then no need to do it in this PR.
Can you remember and summarize what the problem was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I recall, it just didn't work; I got errors from fairly normal usage like
class X[T](Base):
(which needs to double-inherit from Base and Generic).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any recollection as to what the error messages were?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sorry. I can try it out tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually misremembered; the failures were a bit less basic: they had to do with the inheritance of
__new__
. I went back to commit b38dea4, before I made Generic a heap type. There were several test failures intest_typing
:test_new_called
cpython/Lib/test/test_typing.py
Line 3175 in 7d2deaf
test_no_instantiation
cpython/Lib/test/test_typing.py
Line 2463 in 7d2deaf
A heap type allowed me to simply omit
__new__
and have it be inherited like a normal Python class. With a static type withouttp_new
, the class would not be instantiable, and if I had it set toPyType_GenericNew
,super().__new__
wouldn't be called correctly.There were also some issues with pickling, but those should have been fixable.