Postponed evaluation of annotations can be enabled with from __future__ import annotations and will become mandatory in some future version of Python.
The basic idea is that when the annotation is evaluated at runtime, it will appear as a string and not as the types that the strings represent. Because of this, using annotations for defining Predicate sub-classes or using annotations with function signature to define '@' ASP functions breaks when postponed evaluation of annotations is enabled.
Dealing with this in Clorm may not be straightforward. See this Pydantic issue for some discussion: https://github.com/pydantic/pydantic/issues/2678. I think some of the issues raised could also apply to Clorm.
Postponed evaluation of annotations is documented in PEP 563 https://peps.python.org/pep-0563/
Postponed evaluation of annotations can be enabled with
from __future__ import annotations
and will become mandatory in some future version of Python.The basic idea is that when the annotation is evaluated at runtime, it will appear as a string and not as the types that the strings represent. Because of this, using annotations for defining
Predicate
sub-classes or using annotations with function signature to define '@' ASP functions breaks when postponed evaluation of annotations is enabled.Dealing with this in Clorm may not be straightforward. See this Pydantic issue for some discussion: https://github.com/pydantic/pydantic/issues/2678. I think some of the issues raised could also apply to Clorm.