Skip to content
Permalink
master

Commits on Feb 23, 2022

  1. 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 <>
    hauntsaninja committed Feb 23, 2022
  2. Update Enum docs (#12238)

    After merging #11805 I found out that we are missing several new `Enum` features.
    
    This PR adds them to the docs.
    
    Refs #12026
    Refs #12035
    sobolevn committed Feb 23, 2022

Commits on Feb 22, 2022

  1. 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.
    JukkaL committed Feb 22, 2022
  2. Typeshed cherry-pick: Use int | Any for types.FrameType.f_lineno (#…

    …6935) (#12240)
    
    This fixes some regressions.
    JukkaL committed Feb 22, 2022
  3. Adds docs about Enum type (#11805)

    * Adds docs about `Enum` type
    
    * Better structure
    sobolevn committed Feb 22, 2022
  4. Handle raise Exception(), None on Python2.7 (#11786)

    Closes #11742
    Related #11743
    Related #11289
    Related #11700
    sobolevn committed Feb 22, 2022
  5. Typeshed cherry-pick: Improve signature of overlaps in ipaddress (#7260

    …) (#12236)
    
    This fixes a minor regression.
    JukkaL committed Feb 22, 2022
  6. 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`.
    JukkaL committed Feb 22, 2022

Commits on Feb 20, 2022

  1. BUG: Fix an issubclass failure for protocols with overloaded methods (

    #9904)
    
    Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
    BvB93 and hauntsaninja committed Feb 20, 2022
  2. Update dev-intro.md

    Add a link to Python doc about Python C API, which is a friendly tutorial for beginners.
    97littleleaf11 committed Feb 20, 2022
  3. Coalesce Literals when printing Unions (#12205)

    Instead of printing `Union[Literal[X], Literal[Y]]`, these are now
    printed as `Literal[X, Y]`.
    intgr committed Feb 20, 2022
  4. [mypyc] Refactor: Use WrapperGenerator for generate_wrapper_core (#12209

    )
    
    The WrapperGenerator is an abstract class for wrapper generation, 
    originally from generate_wrapper_core. The latter one is fully covered 
    by the WrapperGenerator.
    97littleleaf11 committed Feb 20, 2022
  5. 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 <>
    hauntsaninja committed Feb 20, 2022
  6. 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.
    hauntsaninja committed Feb 20, 2022
  7. stubtest: ignore __main__ module (#12218)

    Co-authored-by: hauntsaninja <>
    hauntsaninja committed Feb 20, 2022

Commits on Feb 18, 2022

  1. [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.
    jhance committed Feb 18, 2022

Commits on Feb 17, 2022

  1. 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.
    hauntsaninja committed Feb 17, 2022
  2. Fix crashes in class scoped imports (#12023)

    Fixes #11045, fixes huggingface/transformers#13390
    Fixes #10488
    Fixes #7045
    Fixes #7806
    Fixes #11641
    Fixes #11351
    Fixes #10488
    
    Co-authored-by: @A5rocks
    hauntsaninja committed Feb 17, 2022

Commits on Feb 16, 2022

  1. 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.
    hauntsaninja committed Feb 16, 2022

Commits on Feb 15, 2022

  1. Fix CI (#12181)

    Co-authored-by: hauntsaninja <>
    hauntsaninja committed Feb 15, 2022

Commits on Feb 12, 2022

  1. Add match_args support to attr.s() (#12111)

    * Add `match_args` support to `attr.s()`
    
    * Improve wording
    
    * Serialize `__match_args__`
    
    * More tests
    
    * Addresses review
    
    * Address review
    sobolevn committed Feb 12, 2022
Older