SanPy <[EMAIL PROTECTED]> wrote: > So basically, my question is: is there a way to access a function from > within itself without using its name? > Not really, no. Python is executing a code block, it has no idea which function referenced that code block.
You can get the current code object quite easily (inspect.currentframe ().f_code), but the reference from function to code is one way: a single code object could be used by multiple functions. You can get the source code though, so if you are desperate enough you could try parsing the source code to extract the docstring: print inspect.getsource(inspect.currentframe()) Use the name of the function, that's the best way. -- http://mail.python.org/mailman/listinfo/python-list