Re: Accessing func_name from inside a function
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Accessing func_name from inside a function

From: Alex Martelli <aleaxit@yahoo.com>
Date: Sun Mar 26 2006 - 23:17:18 CEST

Ron Adam <rrr@ronadam.com> 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 being called" -- my use is instead for
"the object of the immediate lexically enclosing scope" (a module,
class, or function). Implementation wouldn't be trivial in today's
CPython, anyway: frames have no references at all to function objects
(only to _code_ objects), and class objects don't even exist untill well
after their top-level code has long finished running; to make Current
possible, these subtle points of semantics would have to be changed in
quite a revolutionary way, especially where classes are concerned.

Alex
Received on Sun Apr 30 21:14:58 2006