AttributeError in "with" statement (3.2.2)

Terry Reedy tjreedy at udel.edu
Sat Dec 17 21:09:36 EST 2011


On 12/16/2011 8:26 PM, Steven D'Aprano wrote:
> On Fri, 16 Dec 2011 17:05:57 -0500, Terry Reedy wrote:

>> It is am important distinction [unbound versus bound]

> It is not an important distinction, and I am not confusing the two.

So we agree on the distinction but disagree on its importance.
Let us leave it at that.

 > Bound or unbound, it is still an instance method.

OK. So 'instance method' is a bit ambiguous (more than I thought, or 
would prefer) in that it can refer to unbound methods, bounds methods, 
or both. So be it.

>>> 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.
>
> If you can't assume I'm carrying on this discussion in good faith,

If you can't assume that I am intelligent and experienced enough to know 
the meaning of def, one on the most basic aspects of Python, and you are 
unwilling to give me the benefit of any doubt you might have on that 
score, but instead go on to 'correct' me publicly, then no, I can't.

>> 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.
>
> I'm glad to hear it. But nevertheless you have made statements (which I
> quoted, and you deleted from your reply) that suggest the opposite.

OK, let us look at the my statement and your 'repetition of the same 
claim further on' that I previously deleted. I wrote

 >> These are bound methods. The instance methods are the functions wrapped.

As I indicated in response to Ethan, I would now revised the second 
sentence now to "The unbound methods are the function wrapped" or "The 
instance-requiring methods are the functions wrapped." But that is not 
important here.

In my opinion, there is no way that anyone reading that in good faith 
could conclude that I do not know the meaning of def statements. They 
are not the subject of discussion in that sentence or the rest of this 
thread. But in response you wrote.

 > I am afraid you are mistaken.

About what? You go on to explain.

 > What you say may very well apply to other languages,
 > but in Python, def creates functions no matter where you
 > execute it. Always and without exception.

So that makes twice that you said or implied that I think the location 
of a def statement changes what it creates, even though I explicitly 
said the opposite when I suggested that the glossary entry might be 
revised. What am I to think at such a tactic. You are normally much more 
careful in what you write.

 > If I have misinterpreted them, or if you had worded them badly,
 > there's no need to attribute malice to me.

I did not do that. I gave my opinion of your statement, just as you have 
given your opinions of mine. I really did not and do not know why you 
misrepresented my knowledge of Python. I actually consider overt 
intentional malice much less likely than other possibilities.

> Calling me a liar

I did not do that, any more than you have been calling me things.

I believe you are asking for the same 'benefit of the doubt' that I 
believe you denied to me.

-- 
Terry Jan Reedy




More information about the Python-list mailing list