Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with postponed evaluation of annotations #129

Closed
daveraja opened this issue Oct 11, 2023 · 0 comments · Fixed by #131
Closed

Dealing with postponed evaluation of annotations #129

daveraja opened this issue Oct 11, 2023 · 0 comments · Fixed by #131
Assignees
Labels
bug Something isn't working

Comments

@daveraja
Copy link
Collaborator

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: pydantic/pydantic#2678. I think some of the issues raised could also apply to Clorm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant