Skip to content

Strictly check lists and tuples? #131

Open
@skogsbaer

Description

@skogsbaer

I think it would be more intuitive for students, if types for lists and tuples where checked strictly.

Currently the following example works because the wrongly typed element is never accessed:

def foo(l: list[int]) -> str:
    return "1"

foo([1,"stefan"])

Changing the example like this leads to a failure:

def foo(l: list[int]) -> str:
    return l[1]

foo([1,"stefan"])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions