You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add an annotation that allows for unpacking/packing a variable only when a condition is met.
Initial design thoughts
Indicated inside of Annotated[...].
User supplied callable, taking the Structured object/proxy object to be packed/unpacked and returning a Truthy value. If True, pack/unpack as normal, if False, behave as if the class never had the attribute in its definition, and fill in that attribute with some (user specified?) default value.
I want to add an annotation that allows for unpacking/packing a variable only when a condition is met.
Initial design thoughts
Annotated[...]
.Structured
object/proxy object to be packed/unpacked and returning a Truthy value. IfTrue
, pack/unpack as normal, ifFalse
, behave as if the class never had the attribute in its definition, and fill in that attribute with some (user specified?) default value.Maybe something like:
The text was updated successfully, but these errors were encountered: