Glyph on Nostr: If you've got a context manager, like so: with foo() as bar: ... What is the word, ...
If you've got a context manager, like so:
with foo() as bar:
...
What is the word, ideally the verb, that describes the relationship between `foo` and `bar`? It's not quite accurate to say `foo` *returns* `bar`, since `foo` returns a context manager that… somethings… `bar`. It doesn't *yield* `bar` either; if yield is involved, it's an implementation detail in contextlib. In app-developer docs saying "Returns a context manager whose __enter__ method which returns …" is tedious. #python
with foo() as bar:
...
What is the word, ideally the verb, that describes the relationship between `foo` and `bar`? It's not quite accurate to say `foo` *returns* `bar`, since `foo` returns a context manager that… somethings… `bar`. It doesn't *yield* `bar` either; if yield is involved, it's an implementation detail in contextlib. In app-developer docs saying "Returns a context manager whose __enter__ method which returns …" is tedious. #python