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

Fix annotation evaluation on inherited dataclasses #21

Merged
merged 1 commit into from Jun 27, 2023

Conversation

mthuurne
Copy link
Member

The _get_fields() function, which runs upon Binder creation, evaluated annotations in the context of the given dataclass, but each annotation should be evaluated in the context of its surrounding class.

This fixes a failure to find:

  • module-scope names in base classes residing in a different module than the dataclass passed to Binder()
  • class-scope names in all base classes

The `_get_fields()` function evaluated annotations in the context of
the given dataclass, but each annotation should be evaluated in the
context of its surrounding class.
@mthuurne mthuurne merged commit 09b7d5c into main Jun 27, 2023
3 checks passed
@mthuurne mthuurne deleted the fix-annotation-eval-inherited-dataclass branch June 27, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant