Skip to content
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

disable promotions #167

Open
KotlinIsland opened this issue Jan 21, 2022 · 1 comment · May be fixed by #781
Open

disable promotions #167

KotlinIsland opened this issue Jan 21, 2022 · 1 comment · May be fixed by #781
Labels

Comments

@KotlinIsland
Copy link
Owner

KotlinIsland commented Jan 21, 2022

make float not act like float | int (and complex act like complex | float) , and bytes not act like bytes | memoryview | bytearray

we can still infer float | int though:

a = 1
reveal_type(a) # float | int

will support configuration per module, to preserve compatibility:

from thirdparty import some_float
reveal_type(some_float) # float | int
@KotlinIsland KotlinIsland added the p-1 high label Mar 8, 2022
@KotlinIsland KotlinIsland changed the title disable ducktyping mode disable promotions Aug 9, 2024
@jorenham
Copy link
Collaborator

jorenham commented Sep 7, 2024

I currently always use (at least) the following (undocumented) settings in vanilla mypy:

disable_bytearray_promotion = true
disable_memoryview_promotion = true

so how about something like:

disable_int_promotion = true
disable_float_promotion = true

@KotlinIsland KotlinIsland linked a pull request Oct 27, 2024 that will close this issue
@KotlinIsland KotlinIsland mentioned this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants