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

Converter type indexing is incompatible with some inheritance structures #1902

Open
braingram opened this issue Feb 7, 2025 · 0 comments
Open

Comments

@braingram
Copy link
Contributor

Class factories and other inheritance patterns can result in dynamic subclasses that can be serialized with the same tag.

Currently asdf expects converters to list all types at index time (when the extension manager is created often when the first AsdfFile instance is made). For the above patterns this is problematic because:

  • subclasses might be defined after the converter is indexed (and there's no way to list the subclass ahead of time)
  • returning the subclasses as Converter.types may require importing a module (which impacts performance) to inspect which subclasses are defined

For these patterns we may want to consider a different way of indexing converters.

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

No branches or pull requests

1 participant