enthought / enthought/traits

'name.+metadata_name'-style notation broken for Event traits

Open
#397 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

A minimal example, running on Python 2.7 and traits 4.6.0:
```
from traits.api import HasTraits, Bool, Event, Instance, on_trait_change

class Child(HasTraits):
evt = Event(random_metadata=True)
other = Bool(random_metadata=True)

class Parent(HasTraits):
child = Instance(Child, args=())

@on_trait_change('child.+random_metadata')
def _things_happening(self):
print("HELP! HELP! I'm being oppressed!")

p = Parent()
# BUG: Next line has no side-effect
p.child.evt = True
# However, for the Bool trai the notification fires
p.child.other = not p.child.other
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.