Skip to content

Commits

Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Aug 12, 2023

  1. Copy the full SHA
    3631528 View commit details
    Browse the repository at this point in the history
  2. Apply TypeVar defaults to functions (PEP 696) (#15387)

    Use TypeVar defaults to resolve fallback return type of functions.
    
    **Note**: Defaults for TypeVarTuples don't yet work, probably a result
    of the limited support for `Unpack` / `TypeVarTuple`.
    
    Ref: #14851
    cdce8p committed Aug 12, 2023
    Copy the full SHA
    9dbb123 View commit details
    Browse the repository at this point in the history
  3. Support __bool__ with Literal in --warn-unreachable (#15645)

    This adds support for `Literal` as return type of `__bool__` in the
    reachability analysis.
    
    Fixes #7008
    kreathon committed Aug 12, 2023
    Copy the full SHA
    742b5c6 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    0e4521a View commit details
    Browse the repository at this point in the history
  5. Sync typeshed (#15792)

    Source commit:
    
    python/typeshed@fe2ebd6
    
    Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
    Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
    3 people committed Aug 12, 2023
    Copy the full SHA
    89c6596 View commit details
    Browse the repository at this point in the history
  6. Add tox.ini to sdist (#15853)

    Fixes #14142
    mtelka committed Aug 12, 2023
    Copy the full SHA
    7f22aaa View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. Improve error code disabling documentation (#15841)

    Provide a concrete example of what file level comments would look like.
    Sort text into sections a little better.
    hauntsaninja committed Aug 10, 2023
    Copy the full SHA
    cfd01d9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    c7d2fa1 View commit details
    Browse the repository at this point in the history
  3. The oldest CAPI version we support right now is 3.7 (#15839)

    Looks like `capi_version < 3.7` is not supported, so I changed the
    lowest version to be `3.7`.
    
    Based on the discord discussion.
    sobolevn committed Aug 10, 2023
    Copy the full SHA
    d0d63b4 View commit details
    Browse the repository at this point in the history
  4. Document new import error codes (#15840)

    See #14740
    
    My PR was pretty old and predates the nice check to ensure error codes
    are documented.
    hauntsaninja committed Aug 10, 2023
    Copy the full SHA
    eab5b50 View commit details
    Browse the repository at this point in the history
  5. Use error subcodes to differentiate import errors (#14740)

    Resolves #9789
    
    Users could use `--disable-error-code=import-untyped` to only ignore
    errors about libraries not having stubs, but continue to get errors
    about e.g. typos in an import name.
    
    The error subcode mechanism is new from #14570. Note that users will now
    get a different error code depending on whether or not a package is
    installed, and may not know that they can use the parent error code to
    ignore the issue regardless. I think this is okay, in general type
    checking results can change if you run them in two different
    environments. Note also that with `--warn-unused-ignore` / `--strict`
    mypy will complain about not having the most specific error code
    hauntsaninja committed Aug 10, 2023
    Copy the full SHA
    78339b9 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2023

  1. New type inference: add support for upper bounds and values (#15813)

    This is a third PR in series following
    #15287 and
    #15754. This one is quite simple: I
    just add basic support for polymorphic inference involving type
    variables with upper bounds and values. A complete support would be
    quite complicated, and it will be a corner case to already rare
    situation. Finally, it is written in a way that is easy to tune in the
    future.
    
    I also use this PR to add some unit tests for all three PRs so far,
    other two PRs only added integration tests (and I clean up existing unit
    tests as well).
    ilevkivskyi committed Aug 9, 2023
    Copy the full SHA
    8c21953 View commit details
    Browse the repository at this point in the history
  2. Revert "Reconsider constraints involving parameter specifications (#1… (

    #15832)
    
    …5272)"
    
    This reverts commit 2aaeda4.
    
    <!-- If this pull request fixes an issue, add "Fixes #NNN" with the
    issue number. -->
    
    (Explain how this PR changes mypy.)
    
    <!--
    Checklist:
    - Read the [Contributing
    Guidelines](https://github.com/python/mypy/blob/master/CONTRIBUTING.md)
    - Add tests for all changed behaviour.
    - If you can't add a test, please explain why and how you verified your
    changes work.
    - Make sure CI passes.
    - Please do not force push to the PR once it has been reviewed.
    -->
    ilevkivskyi committed Aug 9, 2023
    Copy the full SHA
    a7c4852 View commit details
    Browse the repository at this point in the history
  3. Reconsider constraints involving parameter specifications (#15272)

    - Fixes #15037
    - Fixes #15065
    - Fixes #15073
    - Fixes #15388
    - Fixes #15086
    
    Yet another part of #14903 that's
    finally been extracted!
    A5rocks committed Aug 9, 2023
    Copy the full SHA
    2aaeda4 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Update black pre-commit mirror link (#15815)

    The black pre-commit mirror is now hosted at:
    https://github.com/psf/black-pre-commit-mirror
    cdce8p committed Aug 4, 2023
    Copy the full SHA
    5617cdd View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. New type inference: complete transitive closure (#15754)

    This is a first follow-up for #15287 (I like how my PR titles sound like
    research paper titles, LOL)
    
    This PR completes the new type inference foundations by switching to a
    complete and well founded algorithm [1] for transitive closure (that
    replaces more ad hoc initial algorithm that covered 80% of cases and was
    good for experimenting with new inference scheme). In particular the
    algorithm in this PR covers two important edge cases (see tests). Some
    comments:
    * I don't intend to switch the default for `--new-type-inference`, I
    just want to see the effect of the switch on `mypy_primer`, I will
    switch back to false before merging
    * This flag is still not ready to be publicly announced, I am going to
    make another 2-3 PRs from the list in #15287 before making this public.
    * I am not adding yet the unit tests as discussed in previous PR. This
    PR is already quite big, and the next one (support for upper bounds and
    values) should be much smaller. I am going to add unit tests only for
    `transitive_closure()` which is the core of new logic.
    * While working on this I fixed couple bugs exposed in `TypeVarTuple`
    support: one is rare technical corner case, another one is serious,
    template and actual where swapped during constraint inference,
    effectively causing outer/return context to be completely ignored for
    instances.
    * It is better to review the PR with "ignore whitespace" option turned
    on (there is big chunk in solve.py that is just change of indentation).
    * There is one questionable design choice I am making in this PR, I am
    adding `extra_tvars` as an attribute of `Constraint` class, while it
    logically should not be attributed to any individual constraint, but
    rather to the full list of constrains. However, doing this properly
    would require changing the return type of `infer_constrains()` and all
    related functions, which would be a really big refactoring.
    
    [1] Definition 7.1 in https://inria.hal.science/inria-00073205/document
    
    ---------
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    ilevkivskyi and pre-commit-ci[bot] committed Aug 3, 2023
    Copy the full SHA
    0d708cb View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. Copy the full SHA
    2b613e5 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. Copy the full SHA
    54bc37c View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2023

  1. Update pre-commit deps (#15784)

    Closes #15526
    sobolevn committed Jul 30, 2023
    Copy the full SHA
    cb81325 View commit details
    Browse the repository at this point in the history
  2. Change tuple[] repr to tuple[()] (#15783)

    Closes #15782
    sobolevn committed Jul 30, 2023
    Copy the full SHA
    d71afbf View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2023

  1. Copy the full SHA
    002502a View commit details
    Browse the repository at this point in the history
  2. Better tox configuration (#15777)

    It solves two problems:
    1. `fix_annotate` and `async_matrix` were removed in
    #15728
    2. It is better to reuse stuff like `runtests.py` not to rewrite the
    same command we already have
    
    ---------
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    sobolevn and pre-commit-ci[bot] committed Jul 29, 2023
    Copy the full SHA
    710ad44 View commit details
    Browse the repository at this point in the history
  3. Raise RuntimeError with better error messages (#15778)

    While working on #15776 I've noticed
    that some `RuntimeError` do not have enough metadata to understand what
    is going on.
    CI:
    https://github.com/python/mypy/actions/runs/5700479199/job/15450345887
    
    This PR adds more context to error messages.
    sobolevn committed Jul 29, 2023
    Copy the full SHA
    8792ff1 View commit details
    Browse the repository at this point in the history
  4. Remove the Python 37 environment from the tox.ini (#15693)

    Remove the Python 37 environment from the `tox.ini` since Python 3.7 is
    now end of life.
    
    Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
    mbyrnepr2 and AlexWaygood committed Jul 29, 2023
    Copy the full SHA
    6040b23 View commit details
    Browse the repository at this point in the history
  5. [stubtest] Test NamedTuple definitions with default fields (#15774)

    This is a test case for #15680 from
    `stubtest`'s point of view.
    sobolevn committed Jul 29, 2023
    Copy the full SHA
    14efdf2 View commit details
    Browse the repository at this point in the history
  6. Correctly narrow types for tuple[type[X], ...] (#15691)

    `flatten_types` forgot about the second way we represent `tuple` inside.
    
    Closes #15443
    
    ---------
    
    Co-authored-by: Ilya Priven <ilya.konstantinov@gmail.com>
    sobolevn and ikonst committed Jul 29, 2023
    Copy the full SHA
    da1853f View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Copy the full SHA
    a8467c4 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Copy the full SHA
    b901d21 View commit details
    Browse the repository at this point in the history
  2. Don't flag intentionally empty generators unreachable (#15722)

    Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
    ikonst and AlexWaygood committed Jul 26, 2023
    Copy the full SHA
    01c6994 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2023

  1. Copy the full SHA
    d2022a0 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    6bdcc92 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. Raise errors on unbound TypeVars with values (#15732)

    Completes a `TODO` item :)
    
    Refs #15724
    
    ---------
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    sobolevn and pre-commit-ci[bot] committed Jul 21, 2023
    Copy the full SHA
    14e7768 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Copy the full SHA
    383137b View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    88c0c64 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Copy the full SHA
    89ad125 View commit details
    Browse the repository at this point in the history
Older