This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author med2277
Recipients AlexWaygood, JelleZijlstra, cdce8p, gvanrossum, kj, med2277, miss-islington, serhiy.storchaka, sobolevn
Date 2022-02-20.09:11:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645348314.51.0.4527071759.issue44791@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-02-20 09:11:54med2277setrecipients: + med2277, gvanrossum, serhiy.storchaka, JelleZijlstra, miss-islington, sobolevn, kj, AlexWaygood, cdce8p
2022-02-20 09:11:54med2277setmessageid: <1645348314.51.0.4527071759.issue44791@roundup.psfhosted.org>
2022-02-20 09:11:54med2277linkissue44791 messages
2022-02-20 09:11:54med2277create