B
Barrett Lewis
I was recently watching that Raymond Hettinger video on creating Beautiful
Python from this years PyCon.
He mentioned pushing up the new idiom
with ignored(<ignored_exceptions>):
# do some work
I tracked down his commit here http://hg.python.org/cpython/rev/406b47c64480
But am unsure how the yield works in the given situation.
I know about creating generators with yield and have read the docs on how
it maintains state.
I think it works because it is returning control back to the caller
while maintaining the try so if the caller throws it is caught by the
context. Is this correct? I would love an in depth explanation of how this
is working. I am trying to learn as much as possible about the actual
python internals.
Thanks in advance!
-Barrett
Python from this years PyCon.
He mentioned pushing up the new idiom
with ignored(<ignored_exceptions>):
# do some work
I tracked down his commit here http://hg.python.org/cpython/rev/406b47c64480
But am unsure how the yield works in the given situation.
I know about creating generators with yield and have read the docs on how
it maintains state.
I think it works because it is returning control back to the caller
while maintaining the try so if the caller throws it is caught by the
context. Is this correct? I would love an in depth explanation of how this
is working. I am trying to learn as much as possible about the actual
python internals.
Thanks in advance!
-Barrett