On Aug 21, 10:14 am, Bruno Desthuilliers wrote:
> Gabriel Rossetti a écrit :
>
>
>
> > Bruno Desthuilliers wrote:
> >> Gabriel Rossetti a écrit :
> >>> Terry Reedy wrote:
> >> (snip)
> Unlike the class approach, this requires recreating the constant
> functions and dict with each call to
Gabriel Rossetti a écrit :
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
Terry Reedy wrote:
(snip)
Unlike the class approach, this requires recreating the constant
functions and dict with each call to _test. Quick to write but a
bit 'dirty', in my opinion. Another standard idiom is
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
Terry Reedy wrote:
(snip)
Unlike the class approach, this requires recreating the constant
functions and dict with each call to _test. Quick to write but a
bit 'dirty', in my opinion. Another standard idiom is to set up the
constants ou
Gabriel Rossetti a écrit :
Terry Reedy wrote:
(snip)
Unlike the class approach, this requires recreating the constant
functions and dict with each call to _test. Quick to write but a bit
'dirty', in my opinion. Another standard idiom is to set up the
constants outside the function:
def re
Terry Reedy wrote:
Gabriel Rossetti wrote:
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
I thought that since functions are objects, that I could obtain
it's nested functions.
Well, there's probably a very hackish way, but it's not worth the pain.
What Bruno meant here, I belie
Gabriel Rossetti wrote:
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
I thought that since functions are objects, that I could obtain it's
nested functions.
Well, there's probably a very hackish way, but it's not worth the
pain.
What Bruno meant here, I believe, is that there i
Bruno Desthuilliers wrote:
Gabriel Rossetti a écrit :
Hello,
I can't get getattr() to return nested functions,
Of course. Nested functions are not attributes of their container
function.
Ok
I tried this :
>>> def toto():
... def titi():
... pass
... f = getattr(toto
Gabriel Genellina wrote:
En Wed, 20 Aug 2008 05:34:38 -0300, Gabriel Rossetti
<[EMAIL PROTECTED]> escribi�:
I can't get getattr() to return nested functions, I tried this :
>>> def toto():
... def titi():
... pass
... f = getattr(toto, "titi")
... print str(f)
...
>>
Gabriel Rossetti a écrit :
Hello,
I can't get getattr() to return nested functions,
Of course. Nested functions are not attributes of their container function.
I tried this :
>>> def toto():
... def titi():
... pass
... f = getattr(toto, "titi")
... print str(f)
...
En Wed, 20 Aug 2008 05:34:38 -0300, Gabriel Rossetti
<[EMAIL PROTECTED]> escribi�:
I can't get getattr() to return nested functions, I tried this :
>>> def toto():
... def titi():
... pass
... f = getattr(toto, "titi")
... print str(f)
...
>>> toto()
Traceback (most
Gabriel Rossetti <[EMAIL PROTECTED]> writes:
> I can't get getattr() to return nested functions, I tried this :
>
def toto():
> ... def titi():
> ... pass
> ... f = getattr(toto, "titi")
> ... print str(f)
> ...
toto()
> Traceback (most recent call last):
> File
Hello,
I can't get getattr() to return nested functions, I tried this :
>>> def toto():
... def titi():
... pass
... f = getattr(toto, "titi")
... print str(f)
...
>>> toto()
Traceback (most recent call last):
File "", line 1, in
File "", line 4, in toto
AttributeError
12 matches
Mail list logo