At 07:17 AM 5/17/2005 -0700, Guido van Rossum wrote:
>The compiler must generate both code paths but one is wasted.

Not if the default behavior is encapsulated in PyResource_Enter() 
(returning the object if no __enter__) and PyResource_Exit() (a no-op if no 
__exit__).  You're going to have to have the branch and test for slot 
presence *somewhere*.


>I know this is not a very strong argument,

It's not even an actual argument.  :)


>but my gut tells me this
>generalization of the with-statement is wrong, so I'll stick to it
>regardless of the strength of the argument. The real reason will come
>to me.

I don't know about anybody else, but I'd prefer to hear that your gut tells 
you it's wrong, because that at least tells me there's no point in 
arguing.  Pseudo-reasons just make me think there's something to discuss.  :)

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to