Congruence of 'map' and 'for' broken in 2.1??

Quentin Crain nanotech at europa.com
Sat Apr 28 03:20:48 EDT 2001


Neil/All:

Thank you everyone for you help on and off the list!! The speedy response 
was (as always) outstanding.

A quick summary of the reason:

   'for' does not need to know anything about the length of the sequence it 
is being given, while 'map' seems to care.

Not understanding why 'map' wishes to know this (but there is probably a 
reason); I assume filter and reduce have the same requirement. I hope this 
is at least looked at by the Python Developers and I would be willing to 
help in other imaginative ways (not being much of a C programmer).

Thanks!!!

   Quentin

At 02:47 PM 4/27/2001 -0700, Neil Schemenauer wrote:
>nanotech at europa.com wrote:
> > OK, now that my subject line hooked you :) I am trying to determine
> > why I can not use fh.xreadlines() in map:
>
>Use .readlines() instead.  .xreadlines() is a lazy sequence.
>map() could work on the object that xreadlines() returns but I
>guess its not smart enough.  Patches submitted to SourceForge
>will be gladly accepted. :-)
>
>BTW, this is not something that broke in 2.1 since earlier
>versions of Python did not have xreadlines().
>
>   Neil

-------------------------------------------------------------------------
I think we are miscommunicating. I actually expected some confusion with
my last response and I am not sure if there actually was some, but I feel
like it. So, my message is going to assume I did not make my points, but
perhaps you did understand me. If so, then that means *I* did not
understand *YOUR* response - in which case you will need to rephrase.





More information about the Python-list mailing list