from traits.api import Str
class Foo(HasTraits):
a=Str
b=Str()
Is there any behavioral difference between members 'a' and 'b'?
Are trait attributes always instance specific or can they be class members?
There is no difference. MetaHasTraits
(the metaclass behind HasTraits
) will happily consume either form and implicitly instantiate the former without arguments.
Trait attributes are always instance attributes, not class attributes.