Corran Webster

Results 197 comments of Corran Webster

Given that in 6.1.1 the following raised an error: ```python from traits.api import Enum, HasStrictTraits, List class HasDynamicEnumTrait(HasStrictTraits): selected_language = Enum("JavaScript", "PHP") def _selected_language_default(self): return "Python" print(HasDynamicEnumTrait().selected_language) ``` I'm generally...

This is an analysis of the problem, but it could be wrong in detail: `HasStrictTraits` is defined by setting `_ = Disallow`. This defines a prefix trait that matches anything,...

For reference, specifically we are seeing things like this: ![image](https://user-images.githubusercontent.com/600761/107371752-8b754580-6adc-11eb-87e3-8fec7b2802b8.png) Note the slightly larger first line in the code section.

Note that it _does_ work for more deeply nested listeners: ``` from traits.api import HasTraits, List, Instance, Int class GrandChild(HasTraits): value = Int class Child(HasTraits): children = List(Instance(GrandChild)) value =...

A similar issue likely occurs for `Dict` traits and probably needs a similar fix on this line: https://github.com/enthought/traits/blob/master/traits/traits_listener.py#L909

I haven't played with this, but one other possibility is that there may be some solution using a `TypeGuard`.

With some of these, a driver from me is that we don't want multiple, subtly different ways of doing some basic things - the xgetattr/xsetattr thing is one of these,...

> > * what happens if there is no async event loop running? (nothing? error? start an event loop and call run?) > > ... > So I'd vote for...

> The other half of async support that I think I'd want at some point would be the ability to await a Trait change in a coroutine. Yes, that would...