On Thu, May 9, 2013 at 3:37 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > I can see use-cases for separating "make it go" from initialisation. It > all depends on what you might want to do to the object before making it > go. If the answer is "Nothing", then there is no reason not to have the > constructor make it go. If the answer is, "Well, sometimes we need to do > things to the object before making it go", then it makes sense to > separate the two: > > blob = MyBlob(arg1, arg2, agr3) > blob.poke("with a stick") > blob.append(data) > blob.foo = "spam" > blob.make_it_go()
Example use-case: Most GUI frameworks. You create a window, then populate it, then show it. When you create the window object in Python, you expect an actual window to exist, it should have its handle etc. So it's still the same thing; the object is fully created in its constructor. ChrisA -- http://mail.python.org/mailman/listinfo/python-list