Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-103763: Implement PEP 695#103764

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 232 commits intopython:mainfromJelleZijlstra:tvobject
May 16, 2023
Merged

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstraJelleZijlstra commentedApr 24, 2023
edited
Loading

I will update this message as the status of the PR changes.

This is a complete implementation. It incorporates the changes inpython/peps#3122, which were approved by the SC.

I wrote a detailed account of the changes in this PR athttps://jellezijlstra.github.io/pep695

Reviews are welcome on any aspect of the implementation.

Soberia, SigureMo, and shiningmatcha reacted with thumbs up emojiantonagestam, SigureMo, shiningmatcha, and CoolCat467 reacted with heart emoji
msfterictrautand others added30 commitsApril 8, 2023 18:04
…This commit includes:1. Parser updates2. AST updates3. typing.py updates4. Unit testsIt does not include the following:5. Symtable updates6. Compiler updates7. C implementations of TypeVar, TypeVarTuple, ParamSpec, Generic
This fixes compilation for me locally.
This isn't fully functional, but it should be enough to unblock workon the runtime. I'll update this PR as I implement more.
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@JelleZijlstra for commit08d931c 🤖

If you want to schedule another build, you need to add the🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbotsTest PR w/ refleak buildbots; report in status section labelMay 15, 2023
@JelleZijlstra
Copy link
MemberAuthor

I think the refleaks are unrelated, probably#104510.

@Eclips4
Copy link
Member

I think the refleaks are unrelated, probably#104510.

Yeah, you're right.
Fails in test_gzip, test_httpservers, test_nntplib, test_tarfile, test_xmlrpc related to isolation ofio module.

JelleZijlstra reacted with thumbs up emoji

@JelleZijlstraJelleZijlstra merged commit24d8b88 intopython:mainMay 16, 2023
@gvanrossum
Copy link
Member

🎉

antonagestam, erictraut, Fidget-Spinner, sobolevn, carljm, Bluesy1, Mega-JC, and danohn reacted with hooray emoji

carljm added a commit to carljm/cpython that referenced this pull requestMay 16, 2023
* main:pythonGH-104510: Fix refleaks in `_io` base types (python#104516)pythongh-104539: Fix indentation error in logging.config.rst (python#104545)pythongh-104050: Don't star-import 'types' in Argument Clinic (python#104543)pythongh-104050: Add basic typing to CConverter in clinic.py (python#104538)pythongh-64595: Fix write file logic in Argument Clinic (python#104507)pythongh-104523: Inline minimal PGO rules (python#104524)pythongh-103861: Fix Zip64 extensions not being properly applied in some cases (python#103863)pythongh-69152: add method get_proxy_response_headers to HTTPConnection class (python#104248)pythongh-103763: Implement PEP 695 (python#103764)pythongh-104461: Run tkinter test_configure_screen on X11 only (pythonGH-104462)pythongh-104469: Convert _testcapi/watchers.c to use Argument Clinic (python#104503)pythongh-104482: Fix error handling bugs in ast.c (python#104483)pythongh-104341: Adjust tstate_must_exit() to Respect Interpreter Finalization (pythongh-104437)pythonGH-102613: Fix recursion error from `pathlib.Path.glob()` (pythonGH-104373)
@carljm
Copy link
Member

Congrats! Really excellent work on a tight timeframe.

AlexWaygood, antonagestam, Fidget-Spinner, Mega-JC, and j178 reacted with thumbs up emoji

@zen-xu
Copy link

Awesome!

But will python supportMultiple bounds likerust

fromtypingimportProtocolclassDance(Protocol):defdance(self): ...classSing(Protocol):defsing(self): ...defperform[P:Dance+Sing](person:P):person.dance()person.sing()

@sunmy2019
Copy link
Member

sunmy2019 commentedMay 23, 2023
edited
Loading

But will python supportMultiple bounds likerust

fromtypingimportProtocolclassDance(Protocol):defdance(self): ...classSing(Protocol):defsing(self): ...defperform[P:Dance+Sing](person:P):person.dance()person.sing()

It will not, at least not soon. Changes like this often need a PEP. If you are interested in it, new ideas are welcomed athttps://discuss.python.org/c/ideas/6.

As for this specific question, I think you are asking for atyping.Intersection[Dance, Sing]. Some relevant issues here:python/typing#18

https://discuss.python.org/t/type-intersection-and-negation-in-type-annotations/23879

AlexWaygood, zen-xu, and JelleZijlstra reacted with thumbs up emoji

@junkmd
Copy link
Contributor

Adding the feature like aMultiple bounds by using aIntersection symbol and/or an& operator has been discussed for over 6 years atpython/typing#213.

I hope that the adoption of PEP695 will lead to more discussion on this as well and improve the representation of type hints.

jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 22, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 23, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to jacobtylerwalls/astroid that referenced this pull requestJun 25, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
jacobtylerwalls added a commit to pylint-dev/astroid that referenced this pull requestJun 27, 2023
A C-accelerator was introduced for the typing module inPython 3.12 (seepython/cpython#103764).Because a pure python source is no longer available, now we stubout the missing classes and provide some __class_getitem__methods to allow subscripting like Type[int].This may mean when 3.12 is the minimum, we can remove olderbrain features like infer_typing_alias().
@AlexWaygood
Copy link
Member

@python/organization-owners, please block@johnnyjeannatasha as a spammer — see the review on this PR and the comment ata390ec2#commitcomment-124994466

ewdurbin reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@carljmcarljmcarljm approved these changes

@iritkatrieliritkatrieliritkatriel left review comments

@arhadthedevarhadthedevarhadthedev left review comments

@TeamSpen210TeamSpen210TeamSpen210 left review comments

@markshannonmarkshannonmarkshannon left review comments

@lysnikolaoulysnikolaoulysnikolaou left review comments

@Fidget-SpinnerFidget-SpinnerFidget-Spinner left review comments

@sunmy2019sunmy2019sunmy2019 left review comments

@AlexWaygoodAlexWaygoodAlexWaygood left review comments

@Eclips4Eclips4Eclips4 left review comments

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

@isidenticalisidenticalAwaiting requested review from isidenticalisidentical is a code owner

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@encukouencukouAwaiting requested review from encukou

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@ncoghlanncoghlanAwaiting requested review from ncoghlanncoghlan is a code owner

@warsawwarsawAwaiting requested review from warsawwarsaw is a code owner

Assignees
No one assigned
Labels
topic-typingtype-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

19 participants
@JelleZijlstra@TeamSpen210@sunmy2019@Eclips4@bedevere-bot@gvanrossum@Fidget-Spinner@markshannon@carljm@zen-xu@junkmd@AlexWaygood@iritkatriel@arhadthedev@lysnikolaou@msfterictraut@cdce8p@erictraut@larryhastings

[8]ページ先頭

©2009-2025 Movatter.jp