mypy
1122fc6e - Make logic around bind_self() consistent in different code paths (#8021)

Commit
6 years ago
Make logic around bind_self() consistent in different code paths (#8021) Fixes https://github.com/python/mypy/issues/8020 There is a bunch of code/logic duplication around `bind_self()`, mostly because of https://github.com/python/mypy/issues/7724. This PR makes all three main code paths consistently follow the same structure: 1. `freshen_function_type_vars()` 2. `bind_self()` 3. `expand_type_by_instance(..., map_instance_to_supertype())` (a.k.a `map_type_from_supertype()`) I briefly scrolled through other code paths, and it looks like this was last major/obvious inconsistency (although code around `__getattr__`/`__setattr__`/`__get__`/`__set__` looks a bit suspicious).
Author
Parents
Loading