By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,533 Members | 1,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,533 IT Pros & Developers. It's quick & easy.

import and global namespace

P: n/a
I'd like a module than I'm importing to be able to use objects in the
global namespace into which it's been imported. is there a way to do
that?

thanks,
nate

Jul 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
nate a écrit :
I'd like a module than I'm importing to be able to use objects in the
global namespace into which it's been imported. is there a way to do
that?
It's a very bad idea. Instead of asking how to implement a bad solution,
tell us about the real problem.

NB : FWIW, the clean solution probably involve a class...
Jul 12 '06 #2

P: n/a
Dennis Lee Bieber wrote:
On Wed, 12 Jul 2006 02:48:44 +0200, Bruno Desthuilliers
<bd*****************@free.quelquepart.frdeclaime d the following in
comp.lang.python:

>>nate a écrit :
>>>I'd like a module than I'm importing to be able to use objects in the
global namespace into which it's been imported. is there a way to do
that?

<snip>
>>NB : FWIW, the clean solution probably involve a class...


Or a common module that both (all) import...
I'm afraid this would be as messy. Having one module depending on
implicits external names is a good way to spaghetti code.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jul 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.