Quantcast
Channel: The Voidspace Techie Blog
Viewing all articles
Browse latest Browse all 22

Callable object with state using generators

$
0
0
It's often convenient to create callable objects that maintain some kind of state. In Python we can do this with objects that implement the __call__ method and store the state as instance attributes. ... [597 words]

Viewing all articles
Browse latest Browse all 22

Trending Articles