<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Georg Brandl a &eacute;crit&nbsp;:
<blockquote cite="mid:gra9b8$i57$2@ger.gmane.org" type="cite">
  <pre wrap="">Firephoenix schrieb:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello everyone

I'm a little confused by the recent changes to the generator system...

I basically agreed with renaming the next() method to __next__(), so as 
to follow the naming of other similar methods (__iter__() etc.).
But I noticed then that all the other methods of the generator had 
stayed the same (send, throw, close...), which gives really weird (imo) 
codes :

   next(it)
   it.send(35)
   it.throw(Exception())
   next(it)
   ....

Browsing the web, I've found people troubled by that asymmetry, but no 
remarks on its causes nor its future...

Since __next__(), send() and others have really really close semantics, 
I consider that state as a python wart, one of the few real ones I can 
think of.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
You're missing an important detail: next()/__next__() is a feature of all
iterators, while send() and throw() are generator-only methods.

The only thing I could imagine is to add a generator.next() method that
is simply an alias for generator.__next__(). However, TSBOOWTDI.

cheers,
Georg

  </pre>
</blockquote>
Good point indeed.<br>
<br>
Generator methods (send, throw...) are some kind of black magic
compared to normal methods, so I'd find it normal if their naming
reflected this specificity, but on the other end it wouldn't be cool to
overflow the builtin scope with all the corresponding functions
"send(iter, var)"... so I guess all that will stay the way it is.<br>
<br>
Regards, <br>
Pascal<br>
<br>
</body>
</html>