[Python-Dev] The Return Of Argument Clinic (original) (raw)
R. David Murray rdmurray at bitdance.com
Tue Aug 6 11:44:15 CEST 2013
- Previous message: [Python-Dev] The Return Of Argument Clinic
- Next message: [Python-Dev] The Return Of Argument Clinic
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 05 Aug 2013 16:53:39 -0700, Larry Hastings <larry at 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 "custominit" 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
- Previous message: [Python-Dev] The Return Of Argument Clinic
- Next message: [Python-Dev] The Return Of Argument Clinic
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]