I think you are both missing important point:

classes which support context would be able to be used in "with" contexts";
Nothing would be more complex or slower - you'd only use it to make things
cleaner (move code into class _enter_() and _exit_() methods, which would
only get called (I presume) on with use anyway...  If you have the code in
one place instead of scattered, there is nothing slower or more complex - to
the contrary.

I would agree with you that this could get overused in places (e.g. if it
were used as "syntactic sugar") - but that is a different story.

cvs reader and writer - I had trouble (had to "hack" a fix) with this in the
registration system;  I never provided a patch, because could not see a
good, clean way to decouple application setup from gluon --- THIS is a way
to do that.

I'm pretty sure if I looked, I'd find a few (not many maybe, but a few)
places this would be a good idea, solve existing problems.

I think both of you need to just consider this a little more carefully,
that's all...

- Yarko

On Mon, Jul 13, 2009 at 7:00 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:

>
> I agree with Joe. It require making object context dependent whoch
> would make things unnecessarily more complex and slower.
>
> On Jul 13, 6:42 pm, Joe  Barnhart <joe.barnh...@gmail.com> wrote:
> > I see no benefit to using PEP343 just to provide syntactic sugar for
> > this purpose.  There is no REASON to use the "with" statement because
> > we're not doing anything with exception handling here.  It's only
> > being used to create an input format that looks prettier to some eyes.
> >
> > Am I missing something??
> >
> > On Jul 13, 2:40 pm, Yarko Tymciurak <yark...@gmail.com> wrote:
> >
> > > There are 2 interesting aspects from Luis's  blogger post:
> >
> > > - to use with, classes need to consider contexts;
> > > - the (to me, at least) interesting example of ASP.NET's xmlwriter
> class
> > > (generating SVG dynamically) is... .NET specific;  I'm off busy looking
> for
> > > a python portable idiom to use in place of his last example...
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to