[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
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
[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,
On Feb 28, 8:01 am, 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?
It shouldn't (in any language, not just Python). Callees should not in
general need to inspect their caller's data structures, and shoul
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.
--