the annoying, verbose self

greg greg at cosc.canterbury.ac.nz
Sun Nov 25 00:24:17 CET 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