Gabriel Genellina gagsl-...@yahoo.com.ar wrote:
However, I think that a Python closure is not quite the same thing as a
'computer science' closure, for the same reason that people coming from a
language with variables-and-values as opposed to namespaces get confused
when dealing with
En Fri, 20 Mar 2009 23:16:00 -0300, alex goretoy
aleksandr.gore...@gmail.com escribió:
i looks at lambdas as unbound functions(or super function), in the case
above we create the functions in a list places it in memory unboud, once
binding a call to the memory address space it returns the value
Gabriel Genellina gagsl-...@yahoo.com.ar wrote:
En Fri, 20 Mar 2009 23:16:00 -0300, alex goretoy
aleksandr.gore...@gmail.com escribió:
i looks at lambdas as unbound functions(or super function), in the case
above we create the functions in a list places it in memory unboud, once
binding
Sorry to have confused yall. What I meant was that you can do something like
this, where the fucntion isn't called until it is bount to () with the right
params
def a():
... print inside a
...
def b():
... print inside b
...
def c(a,b):
... a()
... b()
...
d={c:(a,b)}
alex goretoy wrote:
Sorry to have confused yall. What I meant was that you can do something
like
this, where the fucntion isn't called until it is bount to () with the
right
params
def a():
... print inside a
...
def b():
... print inside b
...
def c(a,b):
... a()
...
I'm talking about in function c, where we bind the function call, kinda same
thing with lambdas too, exactly same
def func1(a):
return a
def func2(a=,b=0):
return %s has %d apples%(a,b)
def c(f1,f2,**kwargs):
print f2(kwargs['name'], f1(kwargs['apple'])) #bind call to function 1
and
En Sun, 22 Mar 2009 20:43:02 -0300, alex goretoy
aleksandr.gore...@gmail.com escribió:
Sorry to have confused yall. What I meant was that you can do something
like
this, where the fucntion isn't called until it is bount to () with the
right
params
def a():
... print inside a
...
Ah, so this is a terminology issue. I'd say that a and b are *called* in
function c, not *bound*. I've never seen bind used in this sense before,
but as Humpty Dumpty said to Alice:
i use the word expressively
-Alex Goretoy
http://www.goretoy.com
--
En Sun, 22 Mar 2009 16:42:21 -0300, R. David Murray
rdmur...@bitdance.com escribió:
Gabriel Genellina gagsl-...@yahoo.com.ar wrote:
And if you imply that *where* you call a function does matter, it does
not. A function carries its own local namespace, its own closure, and
its
global
On Mar 20, 12:28 pm, R. David Murray rdmur...@bitdance.com wrote:
Hope this helps. I find that thinking in terms of namespaces helps
me understand how Python works better than any other mental model
I've come across.
It does, thanks.
On Mar 20, 12:41 pm, Michele Simionato
Benjamin Peterson benja...@python.org wrote:
Márcio Faustino m.faustino at gmail.com writes:
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this normal, or is it a problem with
Python? I've tested it with version 2.6.1 on Windows
On Mar 19, 10:52 pm, Márcio Faustino m.faust...@gmail.com wrote:
Hi,
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this normal, or is it a problem with
Python?
It is a common gotcha. Notice that it has nothing to do with lambda
So simple :) thanks!
--
http://mail.python.org/mailman/listinfo/python-list
En Fri, 20 Mar 2009 09:28:08 -0300, R. David Murray
rdmur...@bitdance.com escribió:
Benjamin Peterson benja...@python.org wrote:
Márcio Faustino m.faustino at gmail.com writes:
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this
i looks at lambdas as unbound functions(or super function), in the case
above we create the functions in a list places it in memory unboud, once
binding a call to the memory address space it returns the value
it is basically same as doing this:
def f():
print f
a=f #unbound function, same as
Hi,
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this normal, or is it a problem with
Python? I've tested it with version 2.6.1 on Windows XP.
Thanks,
--
from abc import *
from types import *
import re
class Base (ObjectType):
Márcio Faustino m.faustino at gmail.com writes:
Hi,
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this normal, or is it a problem with
Python? I've tested it with version 2.6.1 on Windows XP.
Thanks,
--
from abc import *
17 matches
Mail list logo