Mehdi2277 <[email protected]> added the comment:
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.
----------
nosy: +med2277
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44791>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com