> On 03 May 2001, Paul F. Dubois said: > > 1. The simple case, X inherits from Y and in defining foo and bar needs to > > use Y's version: > > > > class X (Y rename foo as _sfoo, > > bar as _sbar > > ): [Greg Ward] > Maybe I'm being thick, but don't you get the same effect by doing this: > > class X (Y): > _sfoo = Y.foo > _sbar = Y.bar > > ...or would the "rename" syntax also hide the "foo" and "bar" names from > X's effective namespace[1]? In that case, I guess some special syntax > is needed. Paul's point is that the rename thing makes it possible to deprecate the form Y.foo, which is causing the basic ambiguity here. > [1] "effective namespace" -- the union of X's class dict with all its > superclass' dicts; not actually X's namespace, but the set of names you > can use in X. I think. Err, whatever. Probably irrelevant. --Guido van Rossum (home page: http://www.python.org/~guido/)
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