On Mon, 05 Aug 2013 16:53:39 -0700, Larry Hastings <la...@hastings.org> wrote: > Let me put it this way: Which is more surprising to the person > unfamiliar with the code? That this __init__ doesn't get all the > parameters, and the base class __init__ is getting called > automatically? Or that this funny function "custom_init" is what gets > called, and this class is not allowed to have a function called __init__?
Definitely the former is more surprising. Especially since, as Nick points out, the last part of your statement isn't true: there can be a function called __init__, it just has to replicate the superclass logic if it exists, which is the way Python normally works. I use this "call a hook method from __init__" pattern in the email package's new header parsing code, by the way, for whatever that is worth :) --David _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com