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
The main problem is that there is way to much boilerplate code here. Ideally, the above example should be rewritten into something like this, where unevaluated_expression behaves just like attrs.define():
but that would be hard, if not impossible, to implement.
We probably have to use typing.dataclass_transform, because we want the unevaluated_expression decorator to give the class 'dataclass'-like behavior (see PEP 681).
The content you are editing has changed. Please copy your edits and refresh the page.
Currently, AmpForm provides the following mechanism for defining 'foldable' expression classes (
UnevaluatedExpression
) that make it easier to read large expressions that consist of these folded definitions (see also {doc}/adr/002
). (example taken from ComPWA/compwa.github.io#204, see also for example compwa.github.io/polarimetry/appendix/dynamics.html):The main problem is that there is way to much boilerplate code here. Ideally, the above example should be rewritten into something like this, where
unevaluated_expression
behaves just likeattrs.define()
:Of course, even nicer would be something like this:
but that would be hard, if not impossible, to implement.
We probably have to use
typing.dataclass_transform
, because we want theunevaluated_expression
decorator to give the class 'dataclass'-like behavior (see PEP 681).Tasks
typing.Unpack
in Sphinx builds policy#243The text was updated successfully, but these errors were encountered: