Chocolate [was Re: Python Books for 2002]

Andrew Dalke dalke at acm.org
Tue Apr 10 13:22:18 EDT 2001


Konrad:
>   for food in dir():
>     if food[:2] != '_':
>       eat(food)

Moshe:
>You meant, if food[:1] != '_', otherwise you'd eat people's private
>foods too...

Though food.startswith("__") would be the better solution since
making the mistake of a single _ would not have been as caloric.

                    Andrew
                    dalke at acm.org







More information about the Python-list mailing list