attrs slotted classes #747
rafmudaf
started this conversation in
v3 Design Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The core simulation code of FLORIS largely uses attrs for creating the infrastructure to initialize the low level classes. One feature of attrs is that it by default creates slotted classes which improve performance in CPython.
The attrs documentation says slotted classes do not support monkey patching:
This was a surprise because I have a strong hunch that we have some monkey-patched code in places.
In an attempt to test this feature, I changed the following unit test in the FlowField unit tests:
No error was raised despite
FlowField
being an attrs-class.Beta Was this translation helpful? Give feedback.
All reactions