Raymond Hettinger <raymond.hettin...@gmail.com> added the comment: What kind useful information to you expect to get before an exception is raised?
For example: with suppress(FileNotFoundError) as e: os.remove(somefile) What could *e* possibly be that would be useful. AFAICT, all we know at the time of __enter__ is the exception class. No new information was created by the context manager call. Ideally, it would be great is this API were to remain simple. User code would likely be more clear if any other logic were done outside the context manager rather than happening indirectly and inexplicitly in the suppress call. To me, "suppress" means suppress -- it doesn't mean capture and analyze that which is ignored. So, at first glance, this seems like a mix of feature creep and mission creep. ---------- nosy: +ncoghlan, rhettinger type: -> enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33146> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com