Skip to content

Instantly share code, notes, and snippets.

@chrisgorgo
Created June 28, 2010 17:19
Show Gist options
  • Save chrisgorgo/456117 to your computer and use it in GitHub Desktop.
Save chrisgorgo/456117 to your computer and use it in GitHub Desktop.
from enthought.traits.has_traits import HasTraits
from enthought.traits.trait_base import Undefined
from copy import deepcopy
from nipype.interfaces.traits import File
a = HasTraits()
a.add_trait('foo', File(exists=True))
a.foo = Undefined
print a.traits()
print a.traits()['foo'].trait_type
b = deepcopy(a)
print b.traits()
print b.traits()['foo'].trait_type
b.foo = 'idonotexist'
a.foo = 'idonotexist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment