[Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.

Nick Coghlan ncoghlan at gmail.com
Wed May 9 23:09:22 CEST 2007

Phillip J. Eby wrote:
> At 09:54 PM 5/9/2007 +0200, BJörn Lindqvist wrote:
>> With the non-overloaded version you also have the ability to insert
>> debug print statements to figure out what happens.
> Ahem.
>      @before(do_stuff)
>      def debug_it(ob: ClassC):
>          import pdb
>          pdb.set_trace()
> Note that you don't even need to know what module the behavior you're 
> looking for is even *in*; you only need to know where to import 
> do_stuff and ClassC from, and put the above in a module that's been 
> imported when do_stuff is called.
> In other words, generic functions massively increase your ability to 
> trace specific execution paths.

Possibly another good example to include in the PEP...


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-3000 mailing list