[Python-Dev] PEP Idea: Syntactic sugar for StopIteration.

2007-12-08 Thread Manuel Alejandro Cerón Estrada
Hello Python developers. This is my first post on the list. I have been using Python for a while and I have been thinking about one feature I would like to see integrated into the language. I thought it could be a good topic for a PEP, so I decided to join the list and write about it. First probl

Re: [Python-Dev] PEP Idea: Syntactic sugar for StopIteration.

2007-12-08 Thread Manuel Alejandro Cerón Estrada
2007/12/8, Raymond Hettinger <[EMAIL PROTECTED]>: >...the proposal adds new syntax without adding functionality. That is indeed the definition of syntactic sugar [1]. Python is full of that, for example the import statement. 2007/12/8, Paul Svensson <[EMAIL PROTECTED]>: > What is the problem that

Re: [Python-Dev] PEP Idea: Syntactic sugar for StopIteration.

2007-12-08 Thread Manuel Alejandro Cerón Estrada
2007/12/8, Raymond Hettinger <[EMAIL PROTECTED]>: > In your example, why do you "raise StopIteration" instead just writing > "return"? In the example would be better to use 'return' rather than 'raise StopIteration'. In most cases 'return' will have the same behavior than 'raise StopIteration', b

Re: [Python-Dev] PEP Idea: Syntactic sugar for StopIteration.

2007-12-08 Thread Manuel Alejandro Cerón Estrada
2007/12/8, Greg Ewing <[EMAIL PROTECTED]>: > I would put it the other way around -- the problem > that 'yield break' is meant to solve is already solved > by 'return'. So there's no need for change. I have been re-thinking the problem and this is true. The only exception would be empty generators,