enthought / traits

Observable typed attributes for Python classes
Other
421 stars 85 forks source link

Wouldn't it be possible to split getting and setting prefix traits? #1760

Open Tony1321969 opened 8 months ago

Tony1321969 commented 8 months ago
          Wouldn't it be possible to split getting and setting prefix traits?

On getting, a value would be returned, when it has been set or the prefix trait has a default value. On the latter case, the prefixed trait could be created. Setting would work just as it is currently.

Then no trait would exist where getting raises an exception.

Would this break the current functionality of prefix traits?

Originally posted by @felixkol in https://github.com/enthought/traits/issues/1753#issuecomment-1678731053