[Python-Dev] PEP 409 update [was: PEP 409 (original) (raw)
Ethan Furman ethan at stoneleaf.us
Fri Feb 3 17:52:08 CET 2012
- Previous message: [Python-Dev] PEP 409 update [was: PEP 409 - final?]
- Next message: [Python-Dev] PEP 409 update [was: PEP 409 - final?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yury Selivanov wrote:
Re "raise ValueError from ..."
So what does it mean now? Just resetting cause to make context printed?
Whatever cause was before (None, or an actual exception), it is now Ellipsis -- so context will be printed and the exception chain will be followed.
Can you show the down-to-earth snippet of code where such syntax would be useful?
Not sure I'll ever use it this way, but:
try: try: raise IndexError() except: raise CustomError() from None except CustomError as e:
nevermind, let's see the whole thing after all
raise e from Ellipsis
Ethan
- Previous message: [Python-Dev] PEP 409 update [was: PEP 409 - final?]
- Next message: [Python-Dev] PEP 409 update [was: PEP 409 - final?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]