witty-crayon-22786
10/27/2021, 8:42 PM# python3.8:
>>> cast(dict[str, str], dict())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'type' object is not subscriptable
# python3.9
>>> cast(dict[str, str], dict())
{}
hundreds-father-404
10/27/2021, 8:43 PM""
for cast
because it's not a type hintcast("dict[str, str]", foo)
to Dict[str, str]
w/ an importbitter-ability-32190
10/27/2021, 8:44 PMfrom __future__ import annotations
?hundreds-father-404
10/27/2021, 8:44 PMcast
, which is a normal fucntion call rather than an annotationbitter-ability-32190
10/27/2021, 8:44 PMwitty-crayon-22786
10/27/2021, 11:18 PMbuild-support/bin/generate_docs.py
): should i constrain that to 3.9, or downgrade the syntax? it made it through because mypy
is happy with eitherhundreds-father-404
10/28/2021, 12:13 AM