Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: lazy evaluation of a variable

Reply
Thread Tools

Re: lazy evaluation of a variable

 
 
Cameron Simpson
Guest
Posts: n/a
 
      06-17-2012
On 17Jun2012 23:35, Gelonida N <> wrote:
| I'm having a module, which should lazily evaluate one of it's variables.
| Meaning that it is evaluated only if anybody tries to use this variable.

If it were an object member you could use a property.
Does it need to be a module global?

In related news, can one make "properties" for modules? I was wondering
about this a month or so ago.
--
Cameron Simpson <>

If your new theorem can be stated with great simplicity, then there
will exist a pathological exception. - Adrian Mathesis
 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      06-17-2012
On Mon, 18 Jun 2012 07:44:47 +1000, Cameron Simpson wrote:

> On 17Jun2012 23:35, Gelonida N <> wrote: | I'm having
> a module, which should lazily evaluate one of it's variables. | Meaning
> that it is evaluated only if anybody tries to use this variable.
>
> If it were an object member you could use a property. Does it need to be
> a module global?
>
> In related news, can one make "properties" for modules? I was wondering
> about this a month or so ago.



There have been various half-hearted requests for such a feature,
including by myself, but nothing concrete.

One day, in my Copious Spare Time, I intend to write a proper feature
request and/or PEP for such a feature. Obviously the absolute earliest
such a feature could be introduced is Python 3.4, about 18 months from
now. (Although frankly, I would imagine significant opposition from the
more conservative Python developers.)


--
Steven
 
Reply With Quote
 
 
 
 
rantingrickjohnson@gmail.com
Guest
Posts: n/a
 
      06-19-2012
On Sunday, June 17, 2012 6:01:03 PM UTC-5, Steven D'Aprano wrote:

> One day, in my Copious Spare Time, I intend to write a proper feature
> request and/or PEP for such a feature. Obviously the absolute earliest
> such a feature could be introduced is Python 3.4, about 18 months from
> now. (Although frankly, I would imagine significant opposition from the
> more conservative Python developers.)


Well these conservatives must have been suffering from chronic mononucleosis because i have never heard a peep from them! I wish they would "grow a pair" and speak up a bit more often because the language would benefit greatly from some austerity measures, strong leadership, and most of all; some Gawd damned consistency!
 
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: lazy evaluation of a variable Peter Otten Python 0 06-17-2012 11:40 PM
lazy evaluation of a variable Gelonida N Python 0 06-17-2012 09:35 PM
lazy evaluation is sometimes too lazy... help please. Ken Pu Python 3 01-16-2009 11:23 AM
Re: lazy evaluation is sometimes too lazy... help please. Boris Borcic Python 0 01-16-2009 10:46 AM
Re: lazy evaluation is sometimes too lazy... help please. Boris Borcic Python 0 01-16-2009 10:37 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57