[Python-Dev] Those import related syntax errors again...

Jeremy Hylton jeremy@alum.mit.edu
Wed, 21 Feb 2001 17:30:54 -0500 (EST)


>>>>> "MH" == Mark Hammond <MarkH@ActiveState.com> writes:

  MH> [Thomas W]
  >> appologize) to reduce the impact of the incompatibility. I do not
  >> believe the ability to leave out the default-argument-hack (if
  >> you don't use import-*/exec in the same function) is worth all
  >> that.

  MH> Ironically, I _fixed_ my original problem by _adding_ a
  MH> default-argument-hack.  This meant my lambda no longer used a
  MH> global name but a local one.

  MH> Well, I think it ironic anyway :)

I think it's ironic, too!  I laughed when I read your message.

  MH> For the record, the only reason I had to use exec in that case
  MH> was because the "new" module is not capable creating a new
  MH> method.  Trying to compile a block of code with a "return"
  MH> statement but no function decl (to create a code object suitable
  MH> for a method) fails at compile time.

For the record, I realize that there is no reason for the compiler to
complain about the code you wrote.  If exec supplies an explicit
namespace, then everything is hunky-dory.  Assuming Guido agrees, I'll
fix this ASAP.

Jeremy