traits icon indicating copy to clipboard operation
traits copied to clipboard

Observable typed attributes for Python classes

Results 125 traits issues
Sort by recently updated
recently updated
newest added

Currently the observe machinery raises an exception when there's no trait matching the given name. For example, in ```python from traits.api import HasTraits, Instance, observe class Foo(HasTraits): pass class A(HasTraits):...

type: enhancement
topic: traits listener rework
component: core

Reading the value of an `Event()` trait should be an error, even when it's contained in another trait type. But we have the following behaviour in current Traits: ```python >>>...

type: bug
component: core

Traits doesn't need the MetaHasTraits metaclass: everything it needs to be able to do it can do with the aid of `__init_subclasses__`, introduced in Python 3.6. See #1551 for POC...

type: cleanup
component: core

Currently the new `TraitDict` expects to be supplied a separate `key_validator` and a `value_validator`. We should perhaps be using a single `item_validator` which is given both the key and the...

type: refactor

Currently all three of the new container classes dispatch notification via a simple: ``` for notifier in self.notifiers: notifier(self, index, removed, added) ``` This means that if a single notifier...

type: discussion

At the moment `Expression` trait makes use of `setattr_original_value` and has a validation method that modifies given value. This has caused issues with default value setting (https://github.com/enthought/traits/issues/1087, https://github.com/enthought/traits/issues/1096). The use...

type: refactor

After code resembling this: ```python class Model(HasStrictTraits): foo = List() model = Model() my_list = model.foo ``` `my_list` is now an object of type `TraitListObject`, and is involved in the...

type: bug

This came up a few times in the past (e.g. #886): Currently default value is not validated upon trait initialization, so one could do this ``` from traits.api import Int,...

type: discussion

(Reported in another communication channel by @rahulporuri) > it looks like there are a few objects/type declarations missing from the traits.api module Notably, `HasStrictTraits`, `Interface` and `provides` are missing, but...

type: bug
component: typing stubs

The current policy in `TraitList`, `TraitSet` and friends is that values that are going to be added to the list/set/whatever are passed through the item validator, while values being removed...

type: discussion