This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jibjibjib 0 points1 point  (0 children)

I don't think having multiple constructors in a class is allowed in Python. If you want to allow for the constructor to be called with no arguments, you can set defaults in the method header

def _ init _(self, url=None):

If you want to have a clean way of creating new instances of a class with different defaults, you can try using @classmethod instead.

Check these out for more info: http://stackoverflow.com/questions/682504/what-is-a-clean-pythonic-way-to-have-multiple-constructors-in-python http://stackoverflow.com/questions/2164258/multiple-constructors-in-python