Why this doesn't work?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu Feb 18 17:07:27 EST 2010


On Thu, 18 Feb 2010 18:28:44 +0100, mk wrote:

>      nostat.__orig_get__ = nostat.__get__

I should point out that leading-and-trailing-double-underscore names are 
reserved for use by the language.

It's unlikely that Python will introduce a special method named 
__orig_get__, and in truth the prohibition against using such names is 
honoured more in the breach than in the observance (e.g. people often use 
metadata names like __version__, __author__, etc.). But just be aware 
that you are in technical breach of Python best practices, and should 
consider renaming it as _orig_get or __orig_get.


-- 
Steven



More information about the Python-list mailing list