Why Nostr? What is Njump?
2024-06-20 21:49:07

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
Author Public Key
npub1h5u94g9409m9c6yrckcwk9lg4c6sexyvvk23p0s7s3f42lhrs7zq75y2g4