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.
There is a
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 name in a
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.__name__
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 stdin, line 1, in ?
File stdin, line 2, in foo
NameError: global name
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 method is
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 stdin, line 1, in ?
File stdin, line 2, in foo
NameError:
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 it without the
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) the instance
variable
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 stdin, line 1, in ?
File stdin, line 2, in foo
NameError: global name 'func_name' is not defined
My second
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
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
OK. But that's just as ugly as my attempt.
--
http://mail.python.org/mailman/listinfo/python-list
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, and
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 informed. Any
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 those
Yes,
15 matches
Mail list logo