[issue17030] strange import visibility

2013-01-25 Thread Stephan
Stephan added the comment: Thanks! I was not aware of this yet. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue17030] strange import visibility

2013-01-25 Thread R. David Murray
R. David Murray added the comment: I agree that this is not immediately intuitive. What you need to know is that modules are part of the global state. When b imports dbus.mainloop.glib, it affects the global state of the module dbus, causing mainloop.glib to be defined when 'a' references it.

[issue17030] strange import visibility

2013-01-25 Thread Stephan
New submission from Stephan: $ cat a.py import dbus import b dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) print "Hello, World." $ cat b.py import dbus.mainloop.glib $ python a.py Hello, World. $ If I remove the “import b” line, the output is: $ python a.py Traceback (most recent call l