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

Python: Add support for type parameter defaults #17688

Merged
merged 11 commits into from
Oct 15, 2024

Commits on Oct 15, 2024

  1. Configuration menu
    Copy the full SHA
    1ced5b4 View commit details
    Browse the repository at this point in the history
  2. Python: Add grammar support for type defaults

    Also fixes an oversight in the grammar: starred expressions should be
    allowed inside the subscript of an `Index` expression.
    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    882249e View commit details
    Browse the repository at this point in the history
  3. Python: Regenerate parser files

    Two new files -- alloc.h and array.h -- suddenly appeared. Presumably
    they are used by the somewhat newer version of tree-sitter. To be safe,
    I included them in this commit.
    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    6545bff View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    55ee3eb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2af0d78 View commit details
    Browse the repository at this point in the history
  6. Python: Fix dbscheme/AST autogeneration

    There was an errant `ql` in the relevant paths, a leftover from the move
    from the internal repo. Also, we can no longer rely on an intree version
    of the CodeQL CLI, so from now on we'll just assume it's present in the
    path. (On Codespaces, `gh codeql` is a decent replacement, especially if
    using the `install-stub` functionality.
    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    36d8974 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    182a192 View commit details
    Browse the repository at this point in the history
  8. Python: Update test expectations

    Note that this still includes the somewhat puzzling parsing of
    `Spam[**P2]` as an exponentiation with an empty left hand side. When we
    fix that bug, we should also update this test to contain actually valid
    syntax.
    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    819b3d7 View commit details
    Browse the repository at this point in the history
  9. Python: Add up-/downgrade scripts

    Adds up- and downgrade scripts for the support for type parameter
    defaults.
    
    In the upgrade direction we do nothing, matching the behaviour of
    `getDefault` not having a result for old databases.
    
    In the downgrade direction, we explicitly remove the relevant child (via
    the `py_exprs` database relation) for `TypeVar`, `TypeVarTuple`, and
    `ParamSpec` parameters.
    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    8630f57 View commit details
    Browse the repository at this point in the history
  10. Python: Add change note

    tausbn committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d905010 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    417e60a View commit details
    Browse the repository at this point in the history