-
Notifications
You must be signed in to change notification settings - Fork 242
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
Support most use cases for PEP 612 with Generic #817
Conversation
Thanks! Looks good but let's see what CI says. When I tried this locally on 3.6 it failed with |
Thanks for testing. I managed to get it working locally in 3.6 after much spelunking (wow, typing was so different back then). I don't think I can get the runtime
Other than that, all other versions pass. I'm tempted to just drop 3.5.2 as it's already EOL anyways. |
Since 3.5 is long past its end of life (why can't we say it's "dead"? :-) I
think you shouldn't spend more time trying to figure this out, just disable
that test for 3.5.
…On Fri, Jun 11, 2021 at 9:05 AM Ken Jin ***@***.***> wrote:
Thanks! Looks good but let's see what CI says. When I tried this locally
on 3.6 it failed with AttributeError: 'ParamSpec' object has no attribute
'_get_type_vars'., so we may have to add that method.
Thanks for testing. I managed to get it working locally in 3.6 after much
spelunking (wow, typing was so different back then).
I don't think I can get the runtime __args__ tests to pass with 3.5.2.
Here's a copy from the CI:
=================================== FAILURES ===================================
________________________ ParamSpecTests.test_valid_uses ________________________
self = <test_typing_extensions.ParamSpecTests testMethod=test_valid_uses>
def test_valid_uses(self):
P = ParamSpec('P')
T = TypeVar('T')
C1 = typing.Callable[P, int]
> self.assertEqual(C1.__args__, (P, int))
E AssertionError: Tuples differ: (~P,) != (~P, <class 'int'>)
E
E Second tuple contains 1 additional elements.
E First extra element 1:
E <class 'int'>
E
E - (~P,)
E + (~P, <class 'int'>)
typing_extensions/src_py3/test_typing_extensions.py:2015: AssertionError
Callable in 3.5.2 looks a little strange. Is this a bug in 3.5.2 or am I
missing something here?
https://github.com/python/cpython/blob/91185fe0284a04162e0b3425b53be49bdbfad67d/Lib/typing.py#L762
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#817 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWCWMQP24COIJRO2OCVYNLTSIX3VANCNFSM46Q2G6PA>
.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
|
Thank you! |
This change appears implicated in #865. |
Support PEP 612 and most user-defined generics use cases. This also brings the PEP 612 test suite to near parity with CPython. Note some limitations in valid use cases below simply because of runtime limitations.
Fixes #816.