Re: Subclassing list the right way?

2008-04-25 Thread Matimus
On Apr 25, 7:03 am, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I want to subclass list so that each value in it is calculated at call > time. I had initially thought I could do that by defining my own > __getitem__, but 1) apparently that's deprecated (although I can't > find that; got a link?), a

Re: Subclassing list the right way?

2008-04-25 Thread Virgil Dupras
On Apr 25, 4:03 pm, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I want to subclass list so that each value in it is calculated at call > time.  I had initially thought I could do that by defining my own > __getitem__, but 1) apparently that's deprecated (although I can't > find that; got a link?), a

Subclassing list the right way?

2008-04-25 Thread Kirk Strauser
I want to subclass list so that each value in it is calculated at call time. I had initially thought I could do that by defining my own __getitem__, but 1) apparently that's deprecated (although I can't find that; got a link?), and 2) it doesn't work. For example: >>> class Foo(list): ... de