[Python-Dev] PEP for allowing 'raise NewException from None' (original) (raw)
Ethan Furman ethan at stoneleaf.us
Mon Jan 30 05:51:29 CET 2012
- Previous message: [Python-Dev] PEP for allowing 'raise NewException from None'
- Next message: [Python-Dev] PEP for allowing 'raise NewException from None'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Latest addition for PEP 409 has been sent. Text follows:
Language Details
Currently, context and cause start out as None, and then get set as exceptions occur.
To support 'from None', context will stay as it is, but cause will start out as False, and will change to None when the 'raise ... from None' method is used.
If cause is False the context (if any) will be printed.
If cause is None the context will not be printed.
if cause is anything else, cause will be printed.
This has the benefit of leaving the context intact for future logging, querying, etc., while suppressing its display if it is not caught.
raise ... from ... is not disallowed outside a try block, but this behavior is not guaranteed to remain.
Should that last disclaimer be there? Should it be changed?
Ethan
- Previous message: [Python-Dev] PEP for allowing 'raise NewException from None'
- Next message: [Python-Dev] PEP for allowing 'raise NewException from None'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]