Skip to content

Commit

Permalink
added missing calls to class_init and instance_init for key_trait
Browse files Browse the repository at this point in the history
  • Loading branch information
burnpanck committed Nov 24, 2016
1 parent 92e3323 commit 3dca190
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions traitlets/traitlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,8 @@ def validate_elements(self, obj, value):
def class_init(self, cls, name):
if isinstance(self._value_trait, TraitType):
self._value_trait.class_init(cls, None)
if isinstance(self._key_trait, TraitType):
self._key_trait.class_init(cls, None)
if self._per_key_traits is not None:
for trait in self._per_key_traits.values():
trait.class_init(cls, None)
Expand All @@ -2617,6 +2619,8 @@ def class_init(self, cls, name):
def instance_init(self, obj):
if isinstance(self._value_trait, TraitType):
self._value_trait.instance_init(obj)
if isinstance(self._key_trait, TraitType):
self._key_trait.instance_init(obj)
if self._per_key_traits is not None:
for trait in self._per_key_traits.values():
trait.instance_init(obj)
Expand Down

0 comments on commit 3dca190

Please sign in to comment.