Self function

Rhodri James rhodri at wildebst.demon.co.uk
Tue May 5 21:35:08 EDT 2009


On Tue, 05 May 2009 21:43:16 +0100, <bearophileHUGS at lycos.com> wrote:

> wolfram.hinde...:
>> It is easy to change all references of the function name, except for
>> those in the function body itself? That needs some explantation.
>
> I can answer this. If I have a recursive function, I may want to
> create a similar function, so I copy and paste it, to later modify the
> copied version. Then to change its name I usually don't use a search &
> rename of its name into its block of code because it's usually
> useless. In non-recursive functions the name of the function is stated
> only once, at the top.

I'm sorry, but while I'm mildly positive towards the proposal (and more
so towards Aaron's decorator), I don't buy this argument at all.  What
is broken about your editor's global search-and-replace function that
makes it "usually useless" for making these name changes?

-- 
Rhodri James *-* Wildebeeste Herder to the Masses



More information about the Python-list mailing list