[Python-Dev] PEP 409 update [was: PEP 409 - final?]

Yury Selivanov yselivanov.ml at gmail.com
Sat Feb 4 03:11:29 CET 2012


On 2012-02-03, at 7:23 PM, Terry Reedy wrote:

> On 2/3/2012 9:53 AM, Yury Selivanov wrote:
>> Re "raise ValueError from ..."
> 
> The use cases for Ellipsis/... are 99.99% internal. The typical Python programmer will never see or have cause to worry about such a thing.

I get your points.  But I don't like this argument about some spherical 
"typical Python programmer".  Any programmer at some point may go and 
investigate some bug in stdlib or any other library and see this 
"raise Exc() from ...", or "e = Exc(); e.__cause__ = ...; raise e" nonsense.

BTW, will "raise .. from .." statement allow raising only from exceptions, None, 
and Ellipsis exclusively, or any python object can be used?  Right now it would
throw a TypeError if you try to raise from None or Ellipsis.

And as Benjamin said in the later latter of his -- simple __chain__ 
attribute will be much more understandable, easy to document and explain.
That can be used as simple as writing "raise Exception().no_chaining()" or 
something like that.

-
Yury


More information about the Python-Dev mailing list