Menu

[r4612]: / branches / transforms / mpl1 / test.py  Maximize  Restore  History

Download this file

20 lines (13 with data), 399 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from enthought.traits.api import *
def Alias(name):
return Property(lambda obj: getattr(obj, name),
lambda obj, val: setattr(obj, name, val))
class Path(HasTraits):
strokecolor = Color()
class Line(Path):
color = Alias('strokecolor')
def __init__(self, x, color='red'):
self.x = x
self.color = color
line = Line(1)
print line.strokecolor
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.