Bidirectional communication through pipes: read/write popen()

Oleg Broytmann phd at sun.med.ru
Sun Oct 17 08:59:07 EDT 1999


Hi!

   I marked it with the word "misfeature", but of course I meant only the
problem with mutable types. Sure, I use
   lambda x, y=z: ...
often.
   (But that's another problem. After 10 years with Pascal, I used to use
local functions, that have access to outer function's variables. Learning
to use lambdas was a little pain for me. And I still hope Python will have
local functions sometime... may be 2.0+)

On Sun, 17 Oct 1999, Fredrik Lundh wrote:
> >    Mmm??? Are there a line of code that *relies* on that misfeature?
> 
> yes, there are tons of code that relies on the
> fact that the default values are evaluated once,
> and more importantly, that they are evaluated
> in the namespace where the function/lambda
> is defined.
> 
> in fact, it's currently the only reasonable way
> to pass local variables into a nested namespace
> (like when using lambdas).  it's also often used
> to speed things up, by binding commonly used
> globals to local names.

> but sure, I'm sure Guido is open for proposals. I
> don't think you can get away with "always evaluate
> them on each call," though...

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list