Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
collections use __next__() in python 2.6?
Gary Robinson
2/26/2010 6:08:00 PM
The Python 2.6.4 docs for collections at
http://docs.python.org/library/collec...
say that __next__() is an abstract method for the Iterable ABC. But my understanding is that __next__() isn't supposed to be used until Python 3. Also, I'm using the Mapping ABC, which inherits from Iterable, and it doesn't seem to work if I define __next__(); I am not seeing problems if I define next() instead.
What am I missing?
--
Gary Robinson
CTO
Emergent Music, LLC
personal email: garyrob@me.com
work email: grobinson@flyfi.com
Company:
http://www...
Blog:
http://www.garyro...
1 Answer
Raymond Hettinger
2/26/2010 8:11:00 PM
0
On Feb 26, 10:08 am, Gary Robinson <gary...@me.com> wrote:
> The Python 2.6.4 docs for collections at
http://docs.python.org/library/collectio...
that __next__() is an abstract method for the Iterable ABC. But my understanding is that __next__() isn't supposed to be used until Python 3. Also, I'm using the Mapping ABC, which inherits from Iterable, and it doesn't seem to work if I define __next__(); I am not seeing problems if I define next() instead.
>
> What am I missing?
It's a typo.
The abstract method is next().
Raymond
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
collections use __next__() in python 2.6?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password