Hi, How about this: Given these two files, ## foo.py def __foo(): print "Foo" def bar(): print "Bar" ## bar.py import foo class Foo: self.f = foo.__foo # Create an alias for foo.__foo self.b = foo.bar # Create an alias for foo.bar >>> import bar Traceback (innermost last): File "<stdin>", line 1, in ? File "bar.py", line 3, in ? class Foo: File "bar.py", line 4, in Foo self.f = foo.__foo AttributeError: _Foo__foo If I comment out self.f = foo.__foo all works fine. What am I doing wrong here? Thanks, Scott In article <m3ln8f9y9u.fsf at atrus.jesus.cam.ac.uk>, Michael Hudson wrote: >kain at twilight. (Scott Barron) writes: > > >It's nothing to do with SWIG; try this for size: > >put this in a file called foo.py on your PYTHONPATH: > <snip> > >HTH, >Michael > >O, look: http://www.python.org/doc/current/ref/import.html has all the >gory details...
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