master
Commits on Feb 23, 2022
-
Make pyinfo compatible with Python 2 (#12244)
I'm not adding a test because it's Python 2, but I did test locally. Co-authored-by: hauntsaninja <>
Commits on Feb 22, 2022
-
Use type variable bound to infer constraints (#12230)
This fixes a regression where `iter(x)` could generate a false positive if `x` has a type variable type.
-
Typeshed cherry-pick: Replace some literal types in logging with int (#…
…7354) (#12239) Fixes some regressions. Context: python/typeshed#7258
-
-
Adds docs about
Enum
type (#11805)* Adds docs about `Enum` type * Better structure
-
-
Typeshed cherry-pick: Improve signature of overlaps in ipaddress (#7260…
…) (#12236) This fixes a minor regression.
-
Fix inference of protocol against overloaded function (#12227)
We used to infer a callable in a protocol against all overload items. This could result in incorrect results, if only one of the overload items would actually match the protocol. Fix the issue by only considering the first matching overload item. This seems to help with protocols involving `__getitem__`. In particular, this fixes regressions related to `SupportsLenAndGetItem`, which is used for `random.choice`.
-
Commits on Feb 21, 2022
Commits on Feb 20, 2022
-
BUG: Fix an
issubclass
failure for protocols with overloaded methods (#9904) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
-
Add a link to Python doc about Python C API, which is a friendly tutorial for beginners.
-
Coalesce Literals when printing Unions (#12205)
Instead of printing `Union[Literal[X], Literal[Y]]`, these are now printed as `Literal[X, Y]`.
-
[mypyc] Refactor: Use WrapperGenerator for generate_wrapper_core (#12209
-
stubtest: catch more getattr errors (#12219)
Fixes for python/typeshed#7307 Amusingly, the evil runtime module that is causing havoc is... mypy, which sqlalchemy has some extension for. Co-authored-by: hauntsaninja <>
-
stubtest: error if module level dunder is missing, housekeeping (#12217)
Basically a follow up to #12203 New errors in typeshed from this: ``` _decimal.__libmpdec_version__ is not present in stub _heapq.__about__ is not present in stub builtins.__build_class__ is not present in stub cgitb.__UNDEF__ is not present in stub decimal.__libmpdec_version__ is not present in stub sys.__unraisablehook__ is not present in stub ``` Some general housekeeping, moving things around, renaming things, adding some comments.
-
stubtest: ignore __main__ module (#12218)
Co-authored-by: hauntsaninja <>
Commits on Feb 19, 2022
Commits on Feb 18, 2022
-
[mypyc] Implement additional ircheck checks (#12191)
* Implement more checks in ircheck Check op/register validity and check type coercions for return and assign. * Add checks for call operations, control ops, and literal loads * Add check for duplicate ops In particular, this will catch the case where builder.add() is called twice, which causes very weird bogus IR.
Commits on Feb 17, 2022
-
Fix more crashes in class scoped imports (#12199)
Fixes #12197 This essentially walks back changes in #12023 that apply to function-like things that are imported in class-scope. We just issue a (non-blocking) error and mark the type as Any. Inference for variables still works fine; I'm yet to think of any problems that could cause. A full fix seems quite difficult, but this is better than both a crash and a blocking error.
-
Commits on Feb 16, 2022
-
CONTRIBUTING.md: more words for first-time contributors (#12193)
mypy attracts a lot of (usually student) first-time contributors who tend to comment on issues with things like "May I work on this issue? Can anyone provide me guidance?" and often end up not getting a response. The goal of this PR is to have a section we can just link to as a reply in such situations.
-
Commits on Feb 15, 2022
Commits on Feb 12, 2022
-
Add
match_args
support toattr.s()
(#12111)* Add `match_args` support to `attr.s()` * Improve wording * Serialize `__match_args__` * More tests * Addresses review * Address review