"Gabriel Genellina" 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 Python function ca
En Sun, 22 Mar 2009 16:42:21 -0300, R. David Murray
escribió:
"Gabriel Genellina" 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 namespace. At call time, no additional "binding
>
> 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
--
http://mail.python.org/mailman/listi
En Sun, 22 Mar 2009 20:43:02 -0300, alex goretoy
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"
...
def b():
... print "in
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
an
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
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:
"Gabriel Genellina" wrote:
> En Fri, 20 Mar 2009 23:16:00 -0300, alex goretoy
> 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 r
En Fri, 20 Mar 2009 23:16:00 -0300, alex goretoy
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
it is basically same as do
On Mar 20, 12:28 pm, "R. David Murray" 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
wrote:
> This post http://www.artim
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 a
En Fri, 20 Mar 2009 09:28:08 -0300, R. David Murray
escribió:
Benjamin Peterson wrote:
Márcio Faustino 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
On Mar 19, 10:52 pm, Márcio Faustino 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
functions, you
would
Benjamin Peterson wrote:
> Márcio Faustino 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 XP.
> >
> > Thanks,
>
So simple :) thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Márcio Faustino 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 *
>
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
17 matches
Mail list logo