-
Notifications
You must be signed in to change notification settings - Fork 258
Add PEP 655 Required and NotRequired to typing_extensions #807
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
Conversation
Thanks for submitting this! I'll make a new typing-extensions release for this once it's ready. I don't have time for a full review right now, but two thoughts:
|
Definitely possible, but is it worth the effort? I see Python 3.5 isn't supported in general. But on the other hand I see typing_extensions attempts to provide support not just for 3.5 but also 3.4 and even 2.7. 🤔
The |
def __eq__(self, other): | ||
if not isinstance(other, _Final): | ||
return NotImplemented | ||
if self.__type__ is not None: |
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.
This seems incorrect; it will make Required[str] == NotRequired[str]
return True.
Also, could you add tests for __eq__
?
Thanks again for taking a first look @JelleZijlstra ! I'm prepping for PyCon this weekend, so am hoping next weekend (~5/15) to revise this PR based on feedback. |
Anyone have a tip on easily running the typing_extensions suite on very specific Python versions (especially 3.5.0-3.5.2) locally? I tried to use Docker, via something like:
However it appears that this Docker image for Python lacks the Python's built-in semi-private Probably I'll try Docker again but with a specific Linux image like Ubuntu and try to install Python manually via package manager. |
Honestly I've just been abusing CI for that: push a change and see what happens in 3.5. I tried and failed to get 3.5 to compile locally. |
@davidfstr Any updates? |
Sorry, going through rough patch in my life at the moment and my energy is nil. 😔 I'm projecting I could be out a month or two. Hopefully not, but I've got some rebuilding to do... |
I'm sorry to hear that! No hurry, take your time. |
@davidfstr Hey man, just wanted you to wish you the best on that. Life can be quite challenging. |
@JelleZijlstra If I understand correctly, this works for Python 3.6+, right? In that case, could we just use the current version and worry about Python 3.5 compatibility later (if ever)? |
I'd have to look at the code again to make sure it's ready for 3.6+, but I'm on board in general with not worrying about 3.5. |
Heads up that I'm hoping to get to this PR soon to get it across the finish line. It should be easier now because we dropped support for 3.5 since the PR was created. |
I've regained most of my energy compared with earlier this year, so I am looking at reengaging again with PEP 655 in general starting within the next 1-2 weeks.
Aye. I'll coordinate with you before picking up this PR again. |
Welcome back to the party! |
New version in #937. |
Related to python/mypy#10370