Nov-14-2019, 06:31 AM
Skapern Wrote:i'm sure this has been done beforeIt has. Use
contextlib.contextmanager
and a try..finally
statement containing a yield
.
turning my function into a context manager
|
|
Messages In This Thread |
turning my function into a context manager - by Skaperen - Nov-14-2019, 05:43 AM
RE: turning my function into a context manager - by Gribouillis - Nov-14-2019, 06:31 AM
RE: turning my function into a context manager - by Skaperen - Nov-14-2019, 09:08 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
exception context | Skaperen | 0 | 2,350 |
Mar-06-2021, 08:42 PM Last Post: Skaperen |
|
function to store in caller's context | Skaperen | 7 | 3,092 |
Jul-27-2020, 08:45 PM Last Post: Skaperen |
|
i want to make my own context manager | Skaperen | 0 | 1,693 |
Nov-10-2019, 05:21 AM Last Post: Skaperen |
|
same context functions | Skaperen | 12 | 5,440 |
Jun-18-2019, 06:09 PM Last Post: Skaperen |
|
Windows Context Menu Depth | GWild | 0 | 2,348 |
Jan-27-2018, 07:18 AM Last Post: GWild |