Can a function access its own name?

Mike Meyer mwm at
Sun Nov 20 05:30:32 CET 2005

bobueland at writes:
> Thanks Diez and Peter,
> Just what I was looking for. In "Library Reference" heading
> 3.11.1 Types and members
> Running this yields the result
>     cap(s, n)

You've now got three solutions. They'll work fine most of the time,
but can't be trusted in general. Binding a name to a function doesn't
change the name that these solutions return, and the name they return
may no longer be bound to said function. Just a warning.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list