Default value

Assign default value.

blabla = var or u'defaultvalue'

Not to be used as class or method default value for parameters, since one can directly do

def __init__(self,
             name="Horse with no name",
             alias="Dat horse",

Object special method

How to specify the behavior for str(myobject) or myobject1 + myobject2. This is defined amongst other places in, etc.

def __str__(self):

    def __repr__(self):
        return ','.join(["%s = %r" % (k, v) for k, v in self.__dict__.iteritems()])

    def __eq__(self, other):
        macrodiff = DiffDict(self.macros, other.macros)

        if == and \
           self.alias == other.alias and \
           self.ipaddr == other.ipaddr and \           
           sorted(, key=lambda x: == sorted(, key=lambda x: and \
           self.actionurl == other.actionurl and \
           self.templates == other.templates and \
           not macrodiff.added() and \
           not macrodiff.changed():
           return True
        return False

    def __ne__(self, other):
        return not self.__eq__(other)