import and global namespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nate

    #1

    import and global namespace

    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

  • Bruno Desthuilliers

    #2
    Re: import and global namespace

    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...

    Comment

    • Bruno Desthuilliers

      #3
      Re: import and global namespace

      Dennis Lee Bieber wrote:
      On Wed, 12 Jul 2006 02:48:44 +0200, Bruno Desthuilliers
      <bdesth.quelque chose@free.quel quepart.frdecla imed the following in
      comp.lang.pytho n:
      >
      >
      >>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 'onurb@xiludom. gro'.split('@')])"

      Comment

      Working...