Useful decorator

Paul Rubin http
Sat Apr 14 22:55:07 EDT 2007


Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:
> if __debug__:
>    generate_bazillion_items = truncate(20)(generate_bazillion_items)
> 
> Now you don't have to comment/uncomment dozens of lines all over your
> application, but only set a single global.

The cool thing about organizing the program as a generator pipeline is
you only have to comment or uncomment one line ;).



More information about the Python-list mailing list