Useful decorator

Paul Rubin http
Sun Apr 15 04:55:07 CEST 2007

Steven D'Aprano <steve at> 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