[Python-ideas] replace boolean methods on builtin types with properties [py4k?]

Masklinn masklinn at masklinn.net
Tue Dec 14 12:31:56 CET 2010


On 2010-12-14, at 00:57 , Steven D'Aprano wrote:
> > That
>> way the above mistake would happen less often.
> 
> Making it more difficult and error prone and slower to do things like:
> 
> if all(str.isdigit, list_of_strings):
>    ...
> 
> or similar.
Though I am −0 on the idea as well, this might be solveable by making properties callable and equivalent to unbound method aliases to their fget (e.g. __call__(self, instance) would forward to self.__get__).

In that case, `filter(str.isdigit, list_of_strings)` would work correctly I believe.


More information about the Python-ideas mailing list