Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix daemon crash on malformed NamedTuple (#14119) #1

Merged
merged 10 commits into from
Nov 21, 2022

Commits on Nov 18, 2022

  1. Fix daemon crash on malformed NamedTuple (#14119)

    Fixes #14098 
    
    Having invalid statements in a NamedTuple is almost like a syntax error,
    we can remove them after giving an error (without further analysis).
    This PR does almost exactly the same as
    #13963 did for TypedDicts.
    
    Co-authored-by: Shantanu <[email protected]>
    ilevkivskyi and hauntsaninja authored Nov 18, 2022
    Configuration menu
    Copy the full SHA
    1d6a5b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a206096 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1cc4a7d View commit details
    Browse the repository at this point in the history
  4. Correctly handle Enum name on Python 3.11 (#14133)

    Fixes #12483
    Fixes python/typeshed#7564
    Ref #12841
    
    The fix is straightforward. I can't use a unit test for this because
    there are some builtins fixtures that don't have tuple, so I can't do
    version check.
    ilevkivskyi authored Nov 18, 2022
    Configuration menu
    Copy the full SHA
    05a3f7d View commit details
    Browse the repository at this point in the history
  5. Update code example in "Declaring decorators" (#14131)

    - Added missing cast import
    - Changed revealed type
    
    Co-authored-by: Shantanu <[email protected]>
    ChristianWitzler and hauntsaninja authored Nov 18, 2022
    Configuration menu
    Copy the full SHA
    a2477ff View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2022

  1. Fix type query for recursive aliases (#14136)

    See #14130 for context.
    
    Btw it looks like these `Any` reports are quite broken in general. Some
    issues I found:
    * Many types are reported twice (even non-recursive)
    * Explicit `Any` in alias r.h.s are not counted (because of reckless
    `res = make_any_non_explicit(res)` in semanal.py)
    * For generic aliases we count their r.h.s. as containing `Any` from
    omitted generics
    
    I tried to fix these things, but it is not trivial, so maybe we can do
    it later in a separate PR.
    ilevkivskyi authored Nov 19, 2022
    Configuration menu
    Copy the full SHA
    6cd8e00 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    56e9396 View commit details
    Browse the repository at this point in the history
  3. Fix incremental crash on generic function appearing in nested position (

    #14148)
    
    Fixes #14137 
    
    Fix is trivial, I just forgot to call `super()` in one of my previous
    PRs.
    ilevkivskyi authored Nov 19, 2022
    Configuration menu
    Copy the full SHA
    e814c47 View commit details
    Browse the repository at this point in the history
  4. Make is_recursive and has_recursive_types() more consistent (#14147)

    While working on another PR I noticed that current behavior of
    `has_recursive_types()` is inconsistent, it returns `False` is there is
    a recursive type nested as an argument to a generic non-recursive alias.
    I wasn't able to find any situation where this actually matters, but I
    think it is better if this function behaves consistently.
    ilevkivskyi authored Nov 19, 2022
    Configuration menu
    Copy the full SHA
    f8d71f1 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2022

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