| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- Defer to the PEP 646 implementation in typing.py on 3.11 - Adjust some tests accordingly. Noted a bug in python/cpython#32341 (comment) - typing._type_check() is more lenient in 3.11 and no longer rejects ints - The representation of the empty tuple type changed Tests pass for me on a 3.11 build from today now.
There was a problem hiding this comment.
LGTM, although I have one concern that you can ignore if you wish.
Sorry, something went wrong.
| if TYPING_3_11_0: | ||
| self.assertEqual(repr(Unpack[Ts]), '*Ts') | ||
| else: | ||
| self.assertEqual(repr(Unpack[Ts]), 'typing_extensions.Unpack[Ts]') |
There was a problem hiding this comment.
(Which I forgot to save.)
Wouldn't it make more sense to make the typing_extensions version match the one from Python 3.11?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I was thinking about that too. On the other hand, *Ts is a syntax error before 3.11, so it may not be very helpful as repr() output.
Sorry, something went wrong.
There was a problem hiding this comment.
@mrahtz what do you think? Should we use *Ts in the repr() for Unpack even before 3.11?
Sorry, something went wrong.
There was a problem hiding this comment.
I think I agree it should be Unpack[Ts] before 3.11 - isn't the repr() suppose to be as close as possible to something you can directly eval()?
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, then let's stick with the current behavior.
Sorry, something went wrong.
|
(Thanks, Jelle!) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
gh-87390: Add tests demonstrating current type variable substitution behaviour cpython#32341 (comment)
Tests pass for me on a 3.11 build from today now.