Re: import parent

2007-02-27 Thread Gary Herron
[EMAIL PROTECTED] wrote: > How does one get access to the class that imported a module. For example: > foo imports bar -- how does bar access foo? > > Thanks. > > If bar wants to access foo, it just imports it. If foo imports bar as well, then you have circular imports, but Python can handle

Re: import parent

2007-02-27 Thread Larry Bates
Greg Hoover wrote: > How does one get access to the class that imported a module. For example: > foo imports bar -- how does bar access foo? > > Thanks. > I think we are having a problem understanding what you are asking. If you mean an instance of class foo contains an instance of class bar how

Re: import parent

2007-02-27 Thread Ben Finney
[EMAIL PROTECTED], [EMAIL PROTECTED] writes: > How does one get access to the class that imported a module. For > example: foo imports bar -- how does bar access foo? If bar needs to know something specific from foo, then bar should expose an interface that asks explicitly for that information,

Re: import parent

2007-02-27 Thread John Machin
, then you *may* pass oof as an arg to a bar.some_function which may do things like if oof_arg.zot > 42: oof_arg.zot = 42 but this is not the preferred way. Your subject "import parent" is "interesting". In what way is foo considered to be the parent of bar? f

Re: import parent

2007-02-27 Thread Bjoern Schliessmann
Greg Hoover wrote: > How does one get access to the class that imported a module. For > example: foo imports bar -- how does bar access foo? Directly? Not at all in sane programs, IMHO. That's the job of clear interfaces. Regards, Björn -- BOFH excuse #407: Route flapping at the NAP. --

import parent

2007-02-27 Thread Greg
How does one get access to the class that imported a module. For example: foo imports bar -- how does bar access foo? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parent module idea dropped? [Python import parent package]

2005-04-11 Thread Terry Hancock
Is there a person on > > this list who was against the "parent package" idea? He must know the > > answer or a workaround :-) > > I just created a new module that can handle the 'from __.__.SomeModule > import SomeClass' notation. > Keywords: Python impo

Re: Parent module idea dropped? [Python import parent package]

2005-04-08 Thread Laszlo Zsolt Nagy
now the answer or a workaround :-) I just created a new module that can handle the 'from __.__.SomeModule import SomeClass' notation. Keywords: Python import parent package What is the right place to make it available for others? Laci 2.0 -- ___