On Fri, Feb 3, 2012 at 11:18 AM, Yury Selivanov <yselivanov...@gmail.com> wrote: > That's a bit far-fetched. Using same level argumentation we can utilize > even `0`. `raise e from 0` (or `-1`), and use `0` object instead of > Ellipsis. > > Anyways, if the PEP is not yet fully approved, I'm minus one on allowing > of using anything other than Exception instance or None in 'raise from' > statement.
I read your objection and disagree. The PEP *is* fully approved. > On 2012-02-03, at 2:03 PM, Ethan Furman wrote: > >> Yury Selivanov wrote: >>> On 2012-02-03, at 1:20 PM, Guido van Rossum wrote: >>>> Please. Let's stop this. There is no known use case to ever write >>>> that. We're just not putting specific measures to prevent it. Writing >>>> >>>>>>> a = ... >>>> Is likewise cute but not very informative. But it is valid syntax. >>> Well, right now you'll get TypeError if you want to raise an exception >>> from something that is not an exception. 'raise from None' will >>> loosen the check allowing None values, in the 'raise from' statement, >>> but that should be it. >>> To achieve the same effect as 'raise from ...' just do 'e.__cause__ = ...'. >>> On the question of using Ellipsis instead of some new singleton like >>> __NoContext__: how's Ellipsis semantically related to exceptions after all? >> >> >> Merrian Webster says: >> --------------------- >> el·lip·sis >> noun \i-ˈlip-səs, e-\ >> plural el·lip·ses\-ˌsēz\ >> Definition of ELLIPSIS >> 1 >> a : the omission of one or more words that are obviously understood but that >> must be supplied to make a construction grammatically complete >> --------------------- >> >> Relation to exceptions: >> Two places to look: __context__ and __cause__ >> Priority? __cause__ >> When do we check __context__? if __cause__ is omitted (or Ellipsis) >> >> ~Ethan~ > > _______________________________________________ > 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/guido%40python.org -- --Guido van Rossum (python.org/~guido) _______________________________________________ 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