IIUC (based on issue 59), types like CheckedDict[str, Set[str]] where SP doesn't understand part of the type should:
- be allowed, and
- turn into
CheckedDict[str, object]
But neither seems to work. (I'm running SP commit 1b01cd8.)
First, this type doesn't work except in a constructor call. Other type annotations give an error:
from __static__ import CheckedDict
from typing import Set
def f(dd: CheckedDict[int, Set[str]]):
return
# def f(dd: CheckedDict[int, Set[str]]):
# TypeError: expected type or Optional[T] for generic argument
Second, the constructor call gives a chkdict[str, dynamic] instead of replacing the unknown type with object:
from __static__ import CheckedDict
from typing import Set
d0: CheckedDict[str, dynamic] = CheckedDict[str, Set[str]]({})
# OK
d1: CheckedDict[str, object] = CheckedDict[str, Set[str]]({})
# compiler.errors.TypedSyntaxError: type mismatch: chkdict[str, dynamic] cannot be assigned to chkdict[str, object]
Are these problems?
IIUC (based on issue 59), types like
CheckedDict[str, Set[str]]where SP doesn't understand part of the type should:CheckedDict[str, object]But neither seems to work. (I'm running SP commit 1b01cd8.)
First, this type doesn't work except in a constructor call. Other type annotations give an error:
Second, the constructor call gives a
chkdict[str, dynamic]instead of replacing the unknown type withobject:Are these problems?