Replies: 1 comment
-
We are revampin the subclassing experience to make it easier to use. The new version (coming out this week) should have a better roadmap! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When describing how to make a custom registry, it is said that we can subclass pint's PlainRegistry (and other kinds of registry) like this:
But this returns "AttributeError: module 'pint' has no attribute 'facets'."
I guess this is because pint's
__init__
doesn't import the facets module. Instead, objects defined in facets are accessed throughpint.registry
, wherefrom .facets import ...
is used.These objects (e.g. UnitRegistry, MeasurementRegistry, etc.) are subclasses of PlainRegistry, but PlainRegistry itself is defined in
pint.facets.plain.registry
, which we cannot access.At this point I am stuck and I can't see how to subclass it. How can it be done?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions