-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Enable --disallow-any-generics for stubs #3288
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
Conversation
@@ -105,8 +105,6 @@ class Popen(Generic[_T]): | |||
def send_signal(self, signal: int) -> None: ... | |||
def terminate(self) -> None: ... | |||
def kill(self) -> None: ... | |||
def __enter__(self) -> Popen: ... | |||
def __exit__(self, type, value, traceback) -> None: ... |
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.
These are neither described in the documentation, nor could I find them in the implementation, and a short test also showed they don't exist at runtime.
@@ -55,26 +55,26 @@ Boolean: Type[bool] | |||
class DateTime: | |||
value: str | |||
def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ... | |||
def make_comparable(self, other: _dateTimeComp) -> Tuple[_dateTimeComp, _dateTimeComp]: ... | |||
def make_comparable(self, other: _dateTimeComp) -> Tuple[unicode, unicode]: ... |
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.
This could be tightened by using overloads for other
.
@@ -12,7 +12,7 @@ from gzip import GzipFile | |||
_Unmarshaller = Any | |||
_timeTuple = Tuple[int, int, int, int, int, int, int, int, int] | |||
# Represents types that can be compared against a DateTime object | |||
_dateTimeComp = Union[AnyStr, DateTime, datetime, _timeTuple] |
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.
These methods also accept objects that have a timetuple
attribute, but not a tuple itself. This could be solved using a protocol, but I'll leave that to someone else.
Great job! Thank you for all the fixes! |
As previously, most of these types could probably be tightened down.
Closes #3267