Add hidden options to disable bytes promotion#13952
Add hidden options to disable bytes promotion#13952hauntsaninja merged 5 commits intopython:masterfrom
Conversation
It might be useful to run mypy_primer without promotions in typeshed. This would give us more confidence in changes stemming from python/typeshed#9001
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks, great idea!
I think this should be a public option in the future as part of mypy's migration plan to implement PEP 688, if and when it is accepted. But for now, it's useful as an undocumented option for typeshed.
mypy/main.py
Outdated
| "--enable-incomplete-features", action="store_true", help=argparse.SUPPRESS | ||
| ) | ||
| parser.add_argument( | ||
| "--_disable-bytearray-promotion", action="store_true", help=argparse.SUPPRESS |
There was a problem hiding this comment.
I feel like we don't need the underscore if we're already suppressing the flag.
|
You need to run Black though. |
It might be useful to run mypy_primer without promotions in typeshed. This would give us more confidence in changes stemming from python/typeshed#9001
|
Looking forward to testing this! Thank you! |
|
@dvarrazzo fyi, the mypy-primer output in #12661 (comment) should give you an idea of the effect of disabling the promotions on psycopg. Let me know if you run into any issues where the typeshed stubs don't reflect bytes/bytearray types correctly and I'll help fix them. |
|
@JelleZijlstra I'm afraid I'm not very experienced with running mypy if not from packaged releases. Which repositories should I check out and install in order to try the feature? Thank you! |
|
The option should be in mypy 0.990, which is expected next week. In the meantime you can simply install from git with |
|
This will be part of 0.990, which should hopefully be out in a week or two: #13871 But as of today, |
Add `disable_bytearray_promotion`, `disable_memoryview_promotion` and `enable_incomplete_feature` to the mypy schema. The two first properties are undocumented, but are discussed in this PR: python/mypy#13952 The latter option is described in the mypy documentation: https://mypy.readthedocs.io/en/stable/command_line.html#enabling-incomplete-experimental-features This PR closes #3933.
Add `disable_bytearray_promotion`, `disable_memoryview_promotion` and `enable_incomplete_feature` to the mypy schema. The two first properties are undocumented, but are discussed in this PR: python/mypy#13952 The latter option is described in the mypy documentation: https://mypy.readthedocs.io/en/stable/command_line.html#enabling-incomplete-experimental-features This PR closes SchemaStore#3933.
It might be useful to run mypy_primer without promotions in typeshed. This would give us more confidence in changes stemming from python/typeshed#9001