[Python-ideas] Access to function objects

Jim Jewett jimjjewett at gmail.com
Sun Aug 7 20:00:36 CEST 2011

On Sun, Aug 7, 2011 at 1:36 AM, Steven D'Aprano <steve at pearwood.info> wrote:

> For most uses, standard recursion via the name is good enough, it's only
> a few corner cases where self-reflection (as I call it) is needed.

Self-reflection is a purity issue.  Are you worried about obscure bugs
when something else hijacks the name of your function (or module or
class), but your function is still somehow runnable?

Practicality Beats Purity, but purity still has some value.  I will
also note that names are particularly likely to get reused in some
contexts (GUIs, security proxies) where the writer of the original
code can't rely on anything about the runtime environment.

> I don't think that use-case is so important that it should be implicitly added
> to every function, on the off-chance it is needed, rather than explicitly on
> demand.



More information about the Python-ideas mailing list