[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Iterators / generators for QList(Box, View) and other?
From:       Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date:       2003-04-02 15:27:55
[Download RAW message or body]

On Wednesday 02 April 2003 2:40 pm, Torsten Marek wrote:
> Hello there,
>
> I just wanted to ask if some version of PyQt will support iterators for
> Listboxes, Listviews etc. through generator functions or the __iter__
> protocol? I know both are Python 2.2+ specific, but are there any plans
> to implement them, Phil? Is anybody of you interested in having them? A
> simple iterator for a QListBox using generators would look like this
> (works only with Python 2.2 or greater):
>
>
>
> from __future__ import generators 	# python2.2 only
>
> def ListBoxIterator(listbox):
> 	item = listbox.firstItem()
> 	while item:
> 		yield item
> 		item = item.next()
> 	return 				# no special need to do this
>
> Don't know about generators yet? Read
> http://www.python.org/doc/2.3a2/whatsnew/section-generators.html
> to get a fast intro.

See the SIP Roadmap.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic