-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Description
Consider this:
from traitlets.config import Configurable
class A(Configurable):
x = Int(1)
@validate('x')
def f(self, proposal):
print('validate x')
return proposal.value
A(x=5)prints:
validate x
validate x
while this:
from traitlets import HasTraits
class A(HasTraits):
x = Int(1)
@validate('x')
def f(self, proposal):
print('validate x')
return proposal.value
A(x=5)only validates x once:
validate x
For some reason, Configurable is validating x twice, but HasTraits is only validating once.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels