[Grok-dev] Re: Are functions starting with "handle_"
considered special?
Uli Fouquet
uli at gnufix.de
Tue Sep 11 20:58:26 EDT 2007
Hi there,
Am Dienstag, den 11.09.2007, 16:37 +0200 schrieb Martijn Faassen:
> Jan-Wijbrand Kolman wrote:
> > It seems names starting with 'handle_' are considered special. I'm not
> > sure I like that. Can someone explain why these names are special?
>
> While this is an example I used in Martian, I don't think it would be
> good to actually pick up functions. The problem with this approach is
> that one JW ran into - you can't define functions that start with that
> name anymore.
>
> A better pattern would be to define a docgrok specific base class and
> look for subclasses of those. This eliminates the risk of namespace
> pollution.
The module now uses a class grokker instead of a 'function' grokker (and
checks for correct subclassing). So those kind of problems shouldn't
show up any more.
Kind regards,
--
Uli
More information about the Grok-dev
mailing list