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
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):
...
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
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 =