Python: Simplyfy sequence stores

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-08-03 08:16:43 +02:00
parent 4a8d532a71
commit f21777c6ce
3 changed files with 49 additions and 32 deletions

View File

@@ -74,6 +74,10 @@ def test_list_comprehension():
x = [SOURCE for y in [NONSOURCE]]
SINK(x[0]) # Flow missing
def test_list_comprehension_flow():
x = [y for y in [SOURCE]]
SINK(x[0]) # Flow missing
def test_nested_list_display():
x = [* [SOURCE]]
SINK(x[0]) # Flow missing
@@ -87,6 +91,10 @@ def test_set_comprehension():
x = {SOURCE for y in [NONSOURCE]}
SINK(x.pop()) # Flow missing
def test_set_comprehension_flow():
x = {y for y in [SOURCE]}
SINK(x.pop()) # Flow missing
def test_nested_set_display():
x = {* {SOURCE}}
SINK(x.pop()) # Flow missing
@@ -211,10 +219,10 @@ def test_attribute_reference():
# 6.3.2. Subscriptions
def test_subscription_tuple():
SINK((SOURCE,)[0]) # Flow missing
SINK((SOURCE,)[0])
def test_subscription_list():
SINK([SOURCE][0]) # Flow missing
SINK([SOURCE][0])
def test_subscription_mapping():
SINK({"s":SOURCE}["s"]) # Flow missing