On Sun, Nov 17, 2019, at 14:17, Oscar Benjamin wrote: > Also I don't know of any other misbehaving context managers besides > open so I'm not sure that a general utility is needed rather than just > a well-behaved alternative for open.
It's not in dbapi2, but most database connections are context managers, including sqlite3 in the stdlib. So is requests.Response (so is Session, but AIUI it can't return an error on construction, whereas Response is returned by functions like get which raise exceptions) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/SI5SS37BF3POXVXYPNZTAH2IAOTDZUMZ/ Code of Conduct: http://python.org/psf/codeofconduct/