Where I do ask for a new feature
Cameron Simpson
cs at cskk.id.au
Fri Oct 20 02:41:32 EDT 2023
On 19Oct2023 20:16, Bongo Ferno <bongoferno at gmail.com> wrote:
>A with statement makes clear that the alias is an alias and is local,
>and it automatically clears the variable after the block code is used.
No it doesn't:
>>> with open('/dev/null') as f:
... print(f)
...
<_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'>
>>> print(f)
<_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'>
More information about the Python-list
mailing list