Need some help with 'with'

Aahz aahz at pythoncraft.com
Thu Nov 29 22:43:13 EST 2007


In article <d7d2a3f9-bf83-4737-a6ca-61676ba6f027 at w40g2000hsb.googlegroups.com>,
Mike Kent  <mrmakent at cox.net> wrote:
>
>I figure that if instead of returning the buffer from the context
>directly, I instead returned the buffer in a list, I could then change
>the buffer, put it in the returned list, then I'd have access to it
>back inside the context, but this seems a bit ugly.
>
>Does anyone have insight into the right way of doing this?

You're almost at the right approach: just create a class instance that
contains a buffer attribute.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith



More information about the Python-list mailing list