Re: Alternative constructors naming convention

2006-10-12 Thread Will McGugan
Steven Bethard wrote: > Are you really using staticmethod and calling __new__? It's often much > easier to use classmethod, e.g.:: > > class Color(object): > ... > @classmethod > def from_html(cls, r, g, b): > ... > # convert r, g, b to normal

Re: Alternative constructors naming convention

2006-10-11 Thread Steven Bethard
Will McGugan wrote: > Is there a naming convention regarding alternative constructors? ie > static methods where __new__ is called explicity. Are you really using staticmethod and calling __new__? It's often much easier to use classmethod, e.g.:: class Color(object): ...

Re: Alternative constructors naming convention

2006-10-11 Thread Bruno Desthuilliers
Will McGugan wrote: > Hi, > > Is there a naming convention regarding alternative constructors? ie > static methods where __new__ is called explicity. I use lower_case for > methods in general, but thought maybe CamelCase would be better for > alternative contstructors to distinguish them from meth

Alternative constructors naming convention

2006-10-11 Thread Will McGugan
Hi, Is there a naming convention regarding alternative constructors? ie static methods where __new__ is called explicity. I use lower_case for methods in general, but thought maybe CamelCase would be better for alternative contstructors to distinguish them from methods... So which is better? c =