> > The most common use for these seems to be for calling > > inherited methods, so perhaps something like > > > > inherited MyBaseClass.foo(arg, ...) > > > > which would be equivalent to > > > > getmethod(MyBaseClass, 'foo')(self, arg, ...) > > > > where getmethod() is a new builtin like getattr() > > except that it looks in the __classdict__, and 'self' > > is really whatever the first argument of the containing > > method was. > > The second most common use is to reference class variables > (e.g. imagine a class that keeps counters of how many instances have > been created and deleted in C.initcount and C.delcount). But these > should not have to change, since they really are class attributes. > > > Now that we have __future__, would such a change be contemplatable? > > Or is it too radical to even think about? > > If we can find a way to spell "super.method", we should be ready for > the future. I can't think of something right off the bat > unfortunately. Could we make super(self, MyBaseClass).foo(arg, ...) behave similar to MyBaseClass.foo(self, arg, ...) Wrapping this stuff in a function would probably also enable to use the same pattern in existing python versions. Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4