AttributeError in "with" statement (3.2.2)

Terry Reedy tjreedy at udel.edu
Fri Dec 16 17:05:57 EST 2011


On 12/16/2011 4:22 AM, Steven D'Aprano wrote:
> On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote:
> [...]
>
> After reading your post, I think I have worked out where our disagreement
> lines: you think that bound methods and instance methods are not the same
> thing,

Do you agree that an unbound method and a bound method are different? In 
Python, as indicated by the glossary entry, an unspecified 'method' is 
usually meant to be an unbound method. It is am important distinction 
and I do not see why you insist on confusing the two.

> and that a function defined inside a class is different from a
> function outside of a class.

That, and your repetition of the same claim further on, is a insulting lie.

Def statements always create functions. I have known that for 14 years 
since the first day I started with Python. I have never thought 
differently. If you actually think that I have, you are wrong.

What I have said from my first response is that a function that is an 
attribute of a class, *whether defined in or outside the class*, gets 
special treatment when accessed via an instance of the class. And that 
is the truth.

If you are ever interested in learning anything from me on this subject, 
re=read what I already wrote with a more open mind than you have so far. 
Otherwise, I am done.

-- 
Terry Jan Reedy




More information about the Python-list mailing list