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
ClassVar is (quoting from here in typing docs, emphasis mine):
Special type construct to mark class variables.
[...] a variable annotation wrapped in ClassVar indicates that a given attribute is intended to be used as a class variable and should not be set on instances of that class.
I think it would make sense to exclude any variables whose annotations are wrapped in ClassVar from the list of arguments.
The text was updated successfully, but these errors were encountered:
It would be nice to have an annotation specifically to make Tap ignore variables, e.g., @tap_ignore. Since ClassVar would be less common, asking users to use both might be sufficient. My use case is that I have a complex type that I create from multiple arguments in process_args (right now, I just say not to use it in the comment).
classArgParser(Tap):
params: List[float] = []
""" Even number of entries. Each pair is the mean and standard deviation of the Gaussian underlying a log-normal distribution """@tap_ignoredistributions: List[LogNormal] = []
""" process_args will construct this from params after checking params for validity """
ClassVar
is (quoting from here in typing docs, emphasis mine):I think it would make sense to exclude any variables whose annotations are wrapped in
ClassVar
from the list of arguments.The text was updated successfully, but these errors were encountered: