In article <>,
 jongiddy <> wrote:

> On Sunday, 8 June 2014 02:27:42 UTC+1, Gregory Ewing  wrote:
> > 
> > Also it doesn't sit well with Python's "one obvious
> > way to do it" guideline, because it means there are
> > *two* equally obvious ways to call a function.
> Actually, one of the best arguments against introducing UFCS is that Python 
> currently provides two equivalent ways to check if an instance has an 
> attribute: ask-permission using hasattr and ask-forgiveness using 
> AttributeError.
> On the negative side, these currently equivalent (aside from performance) 
> techniques could give different results using UFCS, potentially breaking some 
> code.

Why?  I assume a language which promoted the global namespace to be in 
the attribute search path (which, as far as I can tell, is what we're 
talking about here) would implement hasattr and raising AttributeError 
in a consistent way.

Reply via email to