-
Notifications
You must be signed in to change notification settings - Fork 10
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
plugin causes open() signature to change #16
Comments
Interesting. This is triggered by overriding This looks like a mypy bug to me. I'll submit the report upstream. |
Apparently mypy doesn't consider this as mypy issue. This bug affects a feature that allows to guess type of a field in a schema, such as textline = zope.schema.TextLine(
title='Title',
description='Optional text line',
required=False) @arnimarj is there any practical issues with the type mismatch? Do you depend on this feature? |
I ran into the issue when passing down the return value of open down to a function which requires BinaryIO. This is the first time encountering this after having annotated in the order on 10k lines, so maybe not a big deal. So in practice not a big deal, but if we start using more plugins that may change. |
I see. I'm going to try suggestion from python/mypy#8331, maybe we can do something about it. |
There is a open PR (python/mypy#9275) which removes the $ mypy --config plugin.ini example.py
example.py:1: note: Revealed type is 'io.TextIOWrapper'
$ mypy example.py
example.py:1: note: Revealed type is 'typing.TextIO' |
I just tested this on the latest mypy (0.800), and this is no longer an issue. |
Hi,
I ran across an interesting issue. The signature of
open()
unexpectedly becametyping.IO[Any]
instead oftyping.TextIO
when the plugin is enabled.example.py
:plugin.ini
:Here is small test:
I created a test-case here:
master...arnimarj:bug/open-signature-changes
The text was updated successfully, but these errors were encountered: