Closed InvincibleRMC closed 1 week ago
I'm not a typing expert. For people like myself, could you please explain in the PR description why adding type[]
is useful?
Hi @InvincibleRMC, could you help by resolving the merge conflicts (I just merged your #5165)?
Description
Similar to #5165 but, adds support for
type[]
(see https://docs.python.org/3.10/library/typing.html#typing.Type).The benefit of adding support for
type[]
allows type checkers to differentiate between different types.By default foo could take any valid python type E.g.
float
orstr
But with allowing specific the type it can narrow valid input properly and
str
would no long be valid.Suggested changelog entry: