More __init__ methods

Mr.SpOOn mr.spoon21 at gmail.com
Thu Nov 6 13:29:51 EST 2008


On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> class A(object):
>    def __init__(self, a, b, c):
>        self.a = a
>        # ...
>
>    @classmethod
>    def from_string(cls, s):
>        # ...
>        return cls(a, b, c)

Thanks.
I think it's time to study decorators.



More information about the Python-list mailing list