Conversation
e2e1470 to
d686377
Compare
d686377 to
7ece722
Compare
58e8130 to
aa22b98
Compare
9f5c185 to
678c257
Compare
JelleZijlstra
left a comment
There was a problem hiding this comment.
- Can you also set
tvt.__bound__ = boundfor consistency? - Can you add tests and a changelog entry?
678c257 to
7d45019
Compare
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #741 +/- ##
==========================================
- Coverage 97.38% 89.72% -7.67%
==========================================
Files 3 3
Lines 7690 7738 +48
==========================================
- Hits 7489 6943 -546
- Misses 201 795 +594
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| def __init__(self, name, *, bound=None, covariant=False, contravariant=False, | ||
| infer_variance=False, default=NoDefault): | ||
| self.__name__ = name | ||
| self.__covariant__ = bool(covariant) |
There was a problem hiding this comment.
Why does this branch call bool() on the variance-related arguments and _type_check on bound and the above one doesn't? We should have things behave the same way across versions.
| self.assertEqual(repr(Ts_contra), '-Ts_contra') | ||
| self.assertEqual(repr(Ts_infer), 'Ts_infer') | ||
| else: | ||
| # Not worth creating our own version of TypeVarTuple |
There was a problem hiding this comment.
I don't understand this comment, we do create our own version in order to add the variance arguments, so we might as well update the repr too.
In general the tests ideally shouldn't have version-dependent branches: it's a goal for typing-extensions for all versions to behave the same.
| Python 3.9. The `typing` implementation has always raised an error, and the | ||
| `typing_extensions` implementation has raised an error on Python 3.10+ since | ||
| `typing_extensions` v4.6.0. Patch by Brian Schubert. | ||
| - add `bound` and variance parameters to `TypeVarTuple` |
There was a problem hiding this comment.
| - add `bound` and variance parameters to `TypeVarTuple` | |
| - Add `bound` and variance parameters to `TypeVarTuple`. |
python/cpython#148212