On 24 Feb 2007, at 16:05 , Edward Muller wrote:
By initializing attributes in the constructor do you mean:

A)

class IA():
        """ The Letter A """

        letter = zope.schema.TextLine(title="The Letter A")

class A():
        implements(IA)

        def __init__(self,...):
                letter = A

This is pretty ineffective, it doesn't store 'letter' on self.


or
B)

class A()
        implements(IA)

        def __init__(self,...):
                self.letter = A

I mean that. Actually, I mean:

class A:
    implements(IA)

    def __init__(self, a, b, c):
        self.a = a
        self.b = b
        self.c = c

perhaps with default values for a,b,c if it makes sense for you.



_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to