Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Is Python Lazy?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


emekamicro at gmail

May 5, 2012, 9:19 PM

Post #1 of 4 (179 views)
Permalink
Is Python Lazy?

Hello All,

Could one say that generator expressions and functions are Python way of
introducing Lazy concept?

Regards, \Emeka
--
*Satajanus Nig. Ltd


*


drsalists at gmail

May 5, 2012, 10:40 PM

Post #2 of 4 (160 views)
Permalink
Re: Is Python Lazy? [In reply to]

Generators and iterators are laziness where you tend to need laziness the
most. Generator expressions are tiny generators - more full fledged
generators are supported.

Python probably won't have laziness at its core ever, but it's nice having
a dose of it. IOW, you probably won't be able to write a sort routine, and
use it as a "first 100 lowest values" routine for free. But you could
construct something that does almost the same thing lazily using a
generator - not for free.

On Sat, May 5, 2012 at 9:19 PM, Emeka <emekamicro [at] gmail> wrote:

>
> Hello All,
>
> Could one say that generator expressions and functions are Python way of
> introducing Lazy concept?
>
> Regards, \Emeka
> --
> *Satajanus Nig. Ltd
>
>
> *
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


stefan_ml at behnel

May 5, 2012, 11:10 PM

Post #3 of 4 (162 views)
Permalink
Re: Is Python Lazy? [In reply to]

Dan Stromberg, 06.05.2012 07:40:
> you probably won't be able to write a sort routine, and
> use it as a "first 100 lowest values" routine for free. But you could
> construct something that does almost the same thing lazily using a
> generator - not for free.

OTOH, if you really wanted to do this particular thing, I'd just use heapq.

Stefan

--
http://mail.python.org/mailman/listinfo/python-list


jeanmichel at sequans

May 9, 2012, 2:37 AM

Post #4 of 4 (155 views)
Permalink
Re: Is Python Lazy? [In reply to]

Emeka wrote:
>
> Hello All,
>
> Could one say that generator expressions and functions are Python way
> of introducing Lazy concept?
>
> Regards, \Emeka
> --
> /Satajanus Nig. Ltd
>
>
> /
No.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.