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

Use __qualname__ for struct tags #399

Merged
merged 1 commit into from
May 2, 2023
Merged

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented May 2, 2023

Previously a struct's tag was generated from its __name__. We now generate it from its __qualname__, excluding any leading namespaces from nested functions. This means that (nested) structs should be tagged the same if defined dynamically within a function as if they were defined at the top level.

This is a breaking change, but should only affect users making use of tagged nested structs relying on the default tagging behavior. A user falling into this category seems unlikely.

Fixes #395.

Previously a struct's tag was generated from its `__name__`. We now
generate it from its `__qualname__`, excluding any leading namespaces
from nested functions. This means that (nested) structs should be tagged
the same if defined dynamically within a function as if they were
defined at the top level.

This is a breaking change, but should only affect users making use of
tagged nested structs relying on the default tagging behavior. A user
falling into this category seems unlikely.
@jcrist jcrist merged commit a189aca into main May 2, 2023
@jcrist jcrist deleted the use-qualname-for-struct-tag branch May 2, 2023 02:36
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.

Support tagged unions for nested classes
1 participant