for item in some_class_object...

Moshe Zadka moshez at math.huji.ac.il
Sat Apr 15 01:36:59 EDT 2000


On Fri, 14 Apr 2000, Ben Wolfson wrote:

> What special methods should I define for a class if I want to support
> a for item in ... syntax for it?

__getitem__
--
Moshe Zadka <mzadka at geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list