471,330 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

interaction of 'with' and 'yield'

I'm wondering if a generator that is within a 'with' scope exits the 'with'
when it encounters 'yield'.

I would like to use a generator to implement RAII without having to
syntactically enclose the code in the 'with' scope, and I am hoping that
the the yield does not exit the 'with' scope and release the resource.

Jul 31 '07 #1
0 744

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

32 posts views Thread by Dave Benjamin | last post: by
75 posts views Thread by David MacQuigg | last post: by
3 posts views Thread by andy.leszczynski | last post: by
22 posts views Thread by Mateuszk87 | last post: by
3 posts views Thread by Ehsan | last post: by
reply views Thread by Omar Abid | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.