the annoying, verbose self

greg greg at cosc.canterbury.ac.nz
Sat Nov 24 18:24:17 EST 2007


samwyse wrote:
> so you might instead
> add 'as' clauses as an alternate way to reduce confusion:
> 
>>>>using myclass.new() as p:
> 
>         p.do_something()
>         p.something_else()

or even

   p = myclass.new()
   p.do_something()
   p.something_else()

Doesn't even need any new syntax. :-)

--
Greg



More information about the Python-list mailing list