Message413573
Concatenate[int, ...] I would interpret as a function signature with first argument int, followed by arbitrary arguments afterwards. I haven't run into this case, but ... is allowed in other spots Paramspec is allowed currently.
P = Paramspec("P")
class Foo(Generic[P]):
...
Foo[...] # Allowed
Callable[..., None] # Allowed
Are there any other places a paramspec is allowed? Generic type argument, first argument to callable, last to concatenate, anything else?
I'm unaware of any type checking use case for Concatenate[int, ...]. You can practically get same thing by using a paramspec variable without using it elsewhere so that it captures, but then effectively discards that information.
def use_func1(f: Callable[Concatenate[int, P], None]) -> None:
...
def use_func2(f: Callable[Concatenate[int, ...], None]) -> None:
...
feels like those two signatures should encode same information. |
|
Date |
User |
Action |
Args |
2022-02-20 09:11:54 | med2277 | set | recipients:
+ med2277, gvanrossum, serhiy.storchaka, JelleZijlstra, miss-islington, sobolevn, kj, AlexWaygood, cdce8p |
2022-02-20 09:11:54 | med2277 | set | messageid: <1645348314.51.0.4527071759.issue44791@roundup.psfhosted.org> |
2022-02-20 09:11:54 | med2277 | link | issue44791 messages |
2022-02-20 09:11:54 | med2277 | create | |
|