[lang-ref] ( assign_with_type_check ) ( python )
def test_assign_with_type_check():
pytest.skip('Not supported in Python')
def test_assign_with_type_check_alternative():
# this is just a type annotation (for tools and readers)
x: int = 1
assert type(x) is int
# it does not mean the runtime enforces the type
x = 1.5
assert x == 1.5
assert type(x) is float