Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: How to make an empty generator?

Reply
Thread Tools

Re: How to make an empty generator?

 
 
John Posner
Guest
Posts: n/a
 
      02-24-2010
On 2/24/2010 9:07 AM, Steve Holden wrote:
> John Posner wrote:


>> Note that the Py2.6.4 documentation is inconsistent. AFAICT, it conforms
>> to Terry's definitions above in most places. But the Glossary says:
>>
>> generator
>> A function which returns an iterator.<... more ...>
>>
>> generator expression
>> An expression that returns a generator.<... more ...>
>>
>> The additional verbiage in these definitions mitigates the damage, but I
>> think the first entry should be headlined *generator function* instead
>> of *generator*. And the Glossary should include Terry's additional entry
>> [ as amended by me ]:
>>
>> generator
>> An iterator produced by a generator function or a generator
>> expression.
>>
>> -John
>>

> +1. Can someone submit a documentation patch, please?
>


Will do. -John
 
Reply With Quote
 
 
 
 
John Posner
Guest
Posts: n/a
 
      02-24-2010
>>> generator
>>> An iterator produced by a generator function or a generator
>>> expression.
>>>
>>> -John
>>>

>> +1. Can someone submit a documentation patch, please?
>>

>
> Will do. -John


[sorry if this is a dup]

Done: #8012 "Revise generator-related Glossary entries"

-John

 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      02-24-2010
In article <(E-Mail Removed)>,
Terry Reedy <(E-Mail Removed)> wrote:
>
>Confusing generators and generator functions is, well, confusing.
>For future reference, and clarity of communication in Pythonland,
>
>generator function: function that produces a generator when called; if
>python coded, its body contains 'yield'.
>
>generator: iterator produced by a generator function; has .__next__ and
>self-returning .__init__, like all other iterators.
>
>generator expression: an expression that evaluates to a generator; the
>expression is used to create a temporary anonymous generator function
>that is called to produce the generator and is then discarded.


My preference is to use the terms "generator" and "generator iterator"
(abbreviated "gen iter" or "geniter").
--
Aahz ((E-Mail Removed)) <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
 
Reply With Quote
 
Michael Rudolf
Guest
Posts: n/a
 
      02-24-2010
Am 24.02.2010 23:58, schrieb Aahz:
> (abbreviated "gen iter" or "geniter").


lol I don't know why, but this sounds like a sex toy to me

Regards,
Michael
 
Reply With Quote
 
Aahz
Guest
Posts: n/a
 
      02-24-2010
In article <hm4bh2$3k4$(E-Mail Removed)-heidelberg.de>,
Michael Rudolf <(E-Mail Removed)> wrote:
>Am 24.02.2010 23:58, schrieb Aahz:
>>
>> (abbreviated "gen iter" or "geniter").

>
>lol I don't know why, but this sounds like a sex toy to me


<smirk> And I thought only smutty Americans would have that twitch.
--
Aahz ((E-Mail Removed)) <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
empty lists vs empty generators Brian Roberts Python 12 05-04-2005 08:59 PM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM
empty/non-empty element John XML 1 07-16-2003 10:23 AM



Advertisments