Skip to content
Permalink
master

Commits on Feb 7, 2022

Commits on Feb 5, 2022

Commits on Feb 4, 2022

Commits on Feb 3, 2022

Commits on Jan 28, 2022

  1. Run self-check on Windows as part of CI (#11909)

    As discussed in #11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.
    AlexWaygood committed Jan 28, 2022
  2. Forbid extra ParamSpec arguments (#12024)

    * Forbid extra `ParamSpec` arguments
    
    * Change error message
    sobolevn committed Jan 28, 2022
  3. Sync typeshed (#11905)

    Source commit:
    python/typeshed@9116b29
    
    * Fix self check
    
    * update testDictWithStarStarSpecialCase
    
    * update testTypedDictMappingMethods
    
    * xfail testAsyncioGatherPreciseType
    
    Co-authored-by: hauntsaninja <>
    hauntsaninja committed Jan 28, 2022

Commits on Jan 27, 2022

  1. stubtest: use VERSIONS for submodules (#12083)

    Closes #12062
    Addresses feedback in #12066
    hauntsaninja committed Jan 27, 2022
  2. Fix error in exclude section (#12078)

    Brings INI and TOML examples in line as noted.
    posita committed Jan 27, 2022

Commits on Jan 26, 2022

  1. Fix crash involving explicit any flag and Required (#12039)

    Co-authored-by: Mehdi Drissi <mdrissi@snapchat.com>
    hmc-cs-mdrissi and Mehdi Drissi committed Jan 26, 2022

Commits on Jan 25, 2022

  1. Add note about wrong error code in type: ignore (#12067)

    If we change the error code of a message, it can result in existing
    "type: ignore" comments being ignored. If this seems to be the case,
    add a note that hints about changing the ignored error code.
    
    Give a more specific message for a set of special cased error codes
    where we know the original error code. In other cases give a more
    vague message.
    JukkaL committed Jan 25, 2022
  2. Fix join of Any against a union type (#12068)

    Make the join of a union type and Any commutative.
    Previously the result depended on the order of the operands,
    which was clearly incorrect.
    
    Fix #12051, but other use cases are affected as well.
    
    This change was split off from #12054.
    JukkaL committed Jan 25, 2022
  3. Simplify unions when erasing last known values (#12064)

    When we erase last known values in an union with multiple
    Instance types, make sure that the resulting union doesn't have
    duplicate erased types. The duplicate items weren't incorrect as such,
    but they could cause overly complex error messages and potentially
    slow type checking performance.
    
    This is one of the fixes extracted from #12054. Since some of the
    changes may cause regressions, it's better to split the PR.
    
    Work on #12051.
    
    Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
    JukkaL and sobolevn committed Jan 25, 2022

Commits on Jan 24, 2022

  1. Explain generic Protocol[T1, T2, ...] shorthand in Mypy docs (#12047)

    As far as I can tell, the nugget exposed by this commit lives only in PEP 544. This
    copies that nugget closer to where it is likely to be spotted by the intended audience.
    
    PEPs may not be accessible to customers who reasonably expect relevant information to be
    surfaced in featured documentation. Even if customers are aware of PEPs, they may not
    think to look there, and don't likely consider them primary sources. It is reasonable to
    assume that is the job of the docs, with PEPs capturing more esoteric nuances,
    rationales and other then-relevant details of decision-making, etc. It's also reasonable
    to expect that where further study may be helpful, links from relevant sections of
    primary sources to secondary materials like PEPs should exist. This commit fills in both
    gaps for the subject shorthand.
    posita committed Jan 24, 2022
  2. Fix crash with yield in comprehension (#12048)

    Fixes #10189
    
    Produce an error when encountering a yield expression (both `yield` and `yield from` clauses) in comprehensions and generator expressions. The latter is a syntax error in python 3.8+; see #10189 and also [python issue 10544](https://bugs.python.org/issue10544).
    alexandrebouayad committed Jan 24, 2022

Commits on Jan 19, 2022

  1. Fix self-check when targeting Python 3.10 (#12020)

    This should fix wheel builds. Our CI always targets Python 3.6
    when doing a self check, which means that we won't catch issues
    specific to more recent Python versions.
    JukkaL committed Jan 19, 2022

Commits on Jan 18, 2022

  1. Move final detection for Enum in checker.py (#11984)

    Fixes #11850
    sobolevn committed Jan 18, 2022
  2. Fix handling of NoReturn in Union return types (#11996)

    There are several discussions and comments describing the following problem 
    (references can be found at the end of the PR summary):
    
    ```python
    def func() -> str | NoReturn:
        ...
    
    func().lower()
    ```
    
    At the moment the code results in: `"NoReturn" of "Union[str, NoReturn]" has no 
    attribute "lower"`
    
    Make `Union[int, NoReturn]` equivalent to `int` in a return type, because in case 
    the function returns it must be `int`.
    kreathon committed Jan 18, 2022

Commits on Jan 17, 2022

  1. Fix __init__ in Dataclasses inheriting from Any (#11966)

    Dataclasses that inherit from Any (actually another type that we don't
    know) should assume an (almost) arbitrary constructor.
    
    Fixes #11921
    joey-laminar committed Jan 17, 2022

Commits on Jan 16, 2022

  1. Clarify stub-only packages need to be installed (#9958)

    * Clarify stub-only packages need to be installed
    * Add link to PEP 561
    gustavgransbo committed Jan 16, 2022

Commits on Jan 15, 2022

  1. Fix #11971 (#11972)

    Allows PlaceholderNode objects before raising an error for the attempted
    reuse of a member name inside an Enum.
    mrossinek committed Jan 15, 2022
Older