3 ms·
Right. I mean, consider your simple python: with some_resource() as resource: some_function_on(resource) Is that broken? If some_function_on sav
by dllthomas 8y ago
Right. I mean, consider your simple python:
with some_resource() as resource:
some_function_on(resource)
Is that broken? If some_function_on saves the resource, yes. If it just temporarily uses it, no.
I don't think the claim that it's syntactically obvious in Python is correct. In both cases the typical syntax helps a little but it's easy to get wrong.
It is the case that "the typical syntax" is a little more enforced by Python-the-language.