-
-
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
Add docutils definitions and (incomplete) modules #5192
Conversation
python/mypy#10242, cc @rchen152: Could you have a look at the pytype errors? I can't make sense of them. I suspect this is also related to using |
The pytype test failures are caused by pytype assuming that some imports are modules when they're actually classes. I filed google/pytype#882. You should be able to work around this by modifying the imports that pytype is unhappy with like this:
|
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.
Thanks! Just two comments
stubs/docutils/docutils/io.pyi
Outdated
encoding: Optional[str] = ..., | ||
error_handler: str = ..., | ||
autoclose: bool = ..., | ||
mode: Literal["r", "rb"] = ..., |
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 is the default but not the only possibility; it also allows rU
in Python 2 at least.
stubs/docutils/docutils/io.pyi
Outdated
def close(self) -> None: ... | ||
|
||
class FileOutput(Output): | ||
mode: ClassVar[Literal["w", "wb"]] |
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 can also be wider; I guess we can use the aliases from _typeshed
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.