-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Hi,
Ver 1.7.0 seems to have introduced issues with the runtime handling of certain type annotations. The cases I have found so far are demonstrated by the following contrived minimal examples:
def foo[K](arg: K) -> K:
ret: K = arg
return ret
foo(1)
causes exception NameError: name 'K' is not defined
def bar(x) -> None:
y: Any[int] = None
bar(1)
gives exception TypeError: type 'Any' is not subscriptable
Both work properly in ver 1.6.4 and are OK with Pylance.
Note that these problems arise with the declaration of the annotated variables above. Other uses of similar constructs seem to work OK, e.g:
def baz(x: Any[int] = None) -> None:
pass
baz()
works fine.
Any thoughts?
pyscript 1.6.4 / 1.7.0
HA OS core 2025.12.1 on RPi4 & RPi3
Metadata
Metadata
Assignees
Labels
No labels