Scott David Daniels wrote:
> Eyal Lotem wrote:
>> By the way, the "real" problem here is referencing by name, rather than
>> using "true" references. Which is the result of using a textual language.
>> The "real" solution would be to store real-references to the function and
>> only present the na
Eyal Lotem wrote:
> By the way, the "real" problem here is referencing by name, rather than
> using "true" references. Which is the result of using a textual language.
> The "real" solution would be to store real-references to the function and
> only present the name in a graphical interface.
Ther
Alex Martelli wrote:
> Ron Adam <[EMAIL PROTECTED]> wrote:
>
>> A "Current" key word would fix this. Or possibly "This" which would be
>> short for "This object".
>
> I think "This" would cause huge confusion, since in other popular
> language the keyword "this" means (a pointer/reference to) "t
Steven D'Aprano wrote:
> On Sun, 26 Mar 2006 10:19:36 +1000, Ben Finney wrote:
>
>> "James Thiele" <[EMAIL PROTECTED]> writes:
>>
>>> I'd like to access the name of a function from inside the function.
>>
>> A function, like most other objects in Python, can have any number of
>> names bound to
James Thiele <[EMAIL PROTECTED]> wrote:
> I'd like to access the name of a function from inside the function. My
> first idea didn't work.
>
> >>> def foo():
> ... print func_name
> ...
> >>> foo()
> Traceback (most recent call last):
> File "", line 1, in ?
> File "", line 2, in foo
> Na
Ron Adam <[EMAIL PROTECTED]> wrote:
> A "Current" key word would fix this. Or possibly "This" which would be
> short for "This object".
I think "This" would cause huge confusion, since in other popular
language the keyword "this" means (a pointer/reference to) "the instance
variable on which the
James Thiele a écrit :
> I'd like to access the name of a function from inside the function. My
> first idea didn't work.
>
>
def foo():
>
> ... print func_name
> ...
>
foo()
>
> Traceback (most recent call last):
> File "", line 1, in ?
> File "", line 2, in foo
> NameError: g
Alex Martelli wrote:
> Personally, I'd rather have a 3.0 keyword referring to "the current
> object" (module for module toplevel code, class for classbody toplevel
> code, function for code within a function) -- say for the sake of
> argument the keyword is 'current'; this would allow current.__na
Ben Finney <[EMAIL PROTECTED]> wrote:
> "James Thiele" <[EMAIL PROTECTED]> writes:
>
> > I'd like to access the name of a function from inside the function.
>
> A function, like most other objects in Python, can have any number of
> names bound to it without the object being informed. Any of tho
On Sun, 26 Mar 2006 10:19:36 +1000, Ben Finney wrote:
> "James Thiele" <[EMAIL PROTECTED]> writes:
>
>> I'd like to access the name of a function from inside the function.
>
> A function, like most other objects in Python, can have any number of
> names bound to it without the object being infor
"James Thiele" <[EMAIL PROTECTED]> writes:
> I'd like to access the name of a function from inside the function.
A function, like most other objects in Python, can have any number of
names bound to it without the object being informed. Any of those
names can then be used to reference the object,
OK. But that's just as ugly as my attempt.
--
http://mail.python.org/mailman/listinfo/python-list
James Thiele wrote:
> I'd like to access the name of a function from inside the function.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062
Kent
--
http://mail.python.org/mailman/listinfo/python-list
James Thiele wrote:
> Is there a standard way of getting the name of a function from inside
> the function?
No, there isn't.
Martin
--
http://mail.python.org/mailman/listinfo/python-list
I'd like to access the name of a function from inside the function. My
first idea didn't work.
>>> def foo():
... print func_name
...
>>> foo()
Traceback (most recent call last):
File "", line 1, in ?
File "", line 2, in foo
NameError: global name 'func_name' is not defined
My second atte
15 matches
Mail list logo