-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use short type var names per PEP 8 #4553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally like the T suffix (#1872 (comment)), but whatever :-)
@@ -55,7 +55,7 @@ class IntParamType(ParamType): | |||
class IntRange(IntParamType): | |||
def __init__(self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ...) -> None: ... | |||
|
|||
_PathType = TypeVar("_PathType", str, bytes) | |||
_PathType = Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_PathType = Any | |
_PathType = AnyStr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_PathType
is never used as a type variable, it's just a glorified Union[str, bytes]
return type. (Which means I can leave my obligatory link to python/typing#566 here.)
This has a couple of merge conflicts now. I'm not sure I like this change; T is fine for a general-purpose typevar, but I find it clearer to use a more explicit name like |
It's also bad user experience in the cases where these types get mentioned in type checker error messages (happened recently where we had to rename |
Closes: #1872