Proposal for attribute and method caching (was: One Python 2.1 idea)

rturpin at my-deja.com rturpin at my-deja.com
Wed Dec 27 04:39:51 CET 2000


Damn! Can't get anything right the first time:

>     if x.__dict__.isIndexable:
>         if x.__class__!=_1:     # New class
>             _1 = x.__class__
>             _3 = x.__dict__.getIndex("foo")
>         if _3:
>             y = x.__dict__.getByIndex(_3)
>         else:
>             <search other namespaces>

The last four lines should be:

          try:
              y = x.__dict__.getByIndex(_3)
          except:
              <search other namespaces>

But y'all likely figured it out, anyway.

Russell


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list