You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What exactly is your use case for indexing P.args? My understanding was the point of a ParamSpec was to pass it through unchanged to another function without looking at any specific argument because it's meant to be a stand-in for any possible set of function arguments.
That means that there's not much you can do with whatever argument you select from args anyways, considering that args[0] can be any type depending on what function the decorator is applied to (and might not even exist if the function doesn't have positional arguments).
Activity
pranavrajpal commentedon Dec 23, 2021
What exactly is your use case for indexing
P.args? My understanding was the point of aParamSpecwas to pass it through unchanged to another function without looking at any specific argument because it's meant to be a stand-in for any possible set of function arguments.That means that there's not much you can do with whatever argument you select from
argsanyways, considering thatargs[0]can be any type depending on what function the decorator is applied to (and might not even exist if the function doesn't have positional arguments).wrobell commentedon Dec 23, 2021
Indeed, PEP-612 says
DMRobertson commentedon May 7, 2022
For cross-referencing, #12668 seems to suppress this error.