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):
...
@classmethod
def from_html(cls, r, g, b):
...
# convert r, g, b to normal constructor args
...
# call normal constructor
return cls(...)
And FWIW, I use lower_with_underscores for alternate constructors, not
CamelCase.
STeVe
--
http://mail.python.org/mailman/listinfo/python-list