[PEAK] Avoiding double naming

Jean-Philippe Dutreve jdutreve at free.fr
Sun Jul 16 14:26:40 EDT 2006


I'm coding derived attributes separately from their elements so that their rules
are reused :

def getLocal(name):
    class attr(model.Attribute):
         # some 'local' rules here
    attr.attrName = name
    return attr

class MyElement(model.Element):
    foo = getLocal('foo')
    bar = getLocal('bar')

How could I avoid double naming as in "foo = getLocal('foo')" ?



More information about the PEAK mailing list