Uh oh!
There was an error while loading. Please reload this page.
Add hidden options to disable bytes promotion - #13952
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.
| "--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.
JelleZijlstra
commented
Oct 27, 2022
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
dvarrazzo
commented
Oct 27, 2022
Looking forward to testing this! Thank you! |
JelleZijlstra
commented
Oct 27, 2022
@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. |
dvarrazzo
commented
Oct 27, 2022
@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! |
JelleZijlstra
commented
Oct 27, 2022
The option should be in mypy 0.990, which is expected next week. In the meantime you can simply install from git with |
hauntsaninja
commented
Oct 27, 2022
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 closesSchemaStore#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