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

Get rid of make_simplified_union() except in error messages #8624

Open
ilevkivskyi opened this issue Apr 3, 2020 · 2 comments
Open

Get rid of make_simplified_union() except in error messages #8624

ilevkivskyi opened this issue Apr 3, 2020 · 2 comments
Labels
bug mypy got something wrong performance priority-1-normal refactoring Changing mypy's internals topic-union-types

Comments

@ilevkivskyi
Copy link
Member

It used to cause various issues and is still causing known bugs (like false negatives in per-file strict optional when map_instance_to_supertype() is involved). Ideally we should replace all calls to it (except in error message formatting code) with UnionType.make_union(). Union constructor already flattens nested unions, we can also make it remove exact duplicates minimize perf impact.

@Akuli
Copy link
Contributor

Akuli commented Oct 3, 2020

Ideally there would be a test case to ensure #9169 won't happen again once the refactoring is done

@97littleleaf11
Copy link
Collaborator

I've noticed that make_simplified_union has been modified several times since this issue opened:

We probably need to reconsider the necessity and ways to refactor make_union and make_simplified_union

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong performance priority-1-normal refactoring Changing mypy's internals topic-union-types
Projects
None yet
Development

No branches or pull requests

4 participants