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 checking multiple assignments based on tuple unpacking involving partially initialised variables (Fixes #12915). #14440

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Jan 12, 2023

  1. Fix checking multiple assignments based on tuple unpacking involving …

    …partially initialised variables (Fixes python#12915).
    
    This proposal is an alternative to python#14423.  Similar to python#14423, the main idea is to convert unions of tuples to tuples of (simplified) unions during multi-assignment checks.  In addition, it extends this idea to other iterable types, which allows removing the `undefined_rvalue` logic and the `no_partial_types` logic.  Hence, the problem reported in python#12915 with partially initialised variables should be fixed for unions that combine, for example, tuples and lists, as well.
    
    Besides the new test case also provided by python#14423 (`testDefinePartiallyInitialisedVariableDuringTupleUnpacking`), this commit also adds the test cases `testUnionUnpackingIncludingListPackingSameItemTypes`, `testUnionUnpackingIncludingListPackingDifferentItemTypes`, and `testUnionUnpackingIncludingListPackingForVariousItemTypes`.
    tyralla committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    d7a8c04 View commit details
    Browse the repository at this point in the history
  2. check Tuple[int, ...]

    tyralla committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    9446ef4 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2023

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

Commits on Jan 15, 2023

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

Commits on Jan 16, 2023

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