Re: lazy evaluation of a variable

Discussion in 'Python' started by Cameron Simpson, Jun 17, 2012.

  1. 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
    Cameron Simpson, Jun 17, 2012
    #1
    1. Advertising

  2. 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
    Steven D'Aprano, Jun 18, 2012
    #2
    1. Advertising

  3. Cameron Simpson

    Guest

    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!
    , Jun 19, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Pu
    Replies:
    3
    Views:
    664
    Steven D'Aprano
    Jan 16, 2009
  2. Boris Borcic
    Replies:
    0
    Views:
    542
    Boris Borcic
    Jan 16, 2009
  3. Boris Borcic
    Replies:
    0
    Views:
    539
    Boris Borcic
    Jan 16, 2009
  4. Gelonida N

    lazy evaluation of a variable

    Gelonida N, Jun 17, 2012, in forum: Python
    Replies:
    0
    Views:
    211
    Gelonida N
    Jun 17, 2012
  5. Peter Otten

    Re: lazy evaluation of a variable

    Peter Otten, Jun 18, 2012, in forum: Python
    Replies:
    0
    Views:
    200
    Peter Otten
    Jun 18, 2012
Loading...

Share This Page