> print(child_pid) # child_pid is undefined
Why on earth would it be undefined?
In [1]: import os
In [2]: with open(os.path.expanduser('~/tmp/xx')) as f:
...: pass
...:
In [3]: print(f)
<_io.TextIOWrapper name='/Users/apalala/tmp/xx' mode='r' encoding='UTF-8'>
In [4]: try:
...: print('ok')
...: raise Exception()
...: except Exception as e:
...: pass
...:
In [5]: print(e)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-5-bb2ea196f768> in <module>()
----> 1 print(e)
NameError: name 'e' is not defined
Anyway, if you want to propose an alternative to PEP 572, you ought to
write your own competing PEP.