Re: [Python-3000] yes to class decorators

2006-11-17 Thread Nick Coghlan
Steven Bethard wrote: > Of course, this is almost exactly what the class statement does under > the covers. That 'almost' you have there covers some pretty significant differences though. > The important points in the code above are the ``MAKE_FUNCTION`` and > ``CALL_FUNCTION`` from the class sta

Re: [Python-3000] yes to class decorators

2006-11-17 Thread Steven Bethard
On 11/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > but here's some abuse that I couldn't help chuckling > over. No need to even bother constructing a class, but don't forget that > 'return locals()' at the end! (not that I'm advocating its [ab]use, > just something that made me smile) > > -

Re: [Python-3000] yes to class decorators

2006-11-16 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > > tomer filiba wrote: > > > we should also note that it's possible to replace "__metaclass__" > > by a @metaclass decorator. > > I don't think so. Your proposed technique for that seems to > involve creating an ordinary class first, then taking it > apart

Re: [Python-3000] yes to class decorators

2006-11-16 Thread Greg Ewing
tomer filiba wrote: > we should also note that it's possible to replace "__metaclass__" > by a @metaclass decorator. I don't think so. Your proposed technique for that seems to involve creating an ordinary class first, then taking it apart and recreating it using the specified metaclass. That sme

Re: [Python-3000] yes to class decorators

2006-11-16 Thread Andre Meyer
On 11/16/06, tomer filiba <[EMAIL PROTECTED]> wrote: we should find some more/better use-cases than what i came up with, and show why class decorators are the right solution, and compare with function decorators. A while ago I was trying to implement the Singleton or Borg design pattern and

Re: [Python-3000] yes to class decorators

2006-11-16 Thread Fredrik Lundh
tomer filiba wrote: >> Did I mention I care about this feature and don't want >> a raft of crazies screwing it up with their own vices? > > i don't get your point. maybe your news server is dropping posts ? ___ Python-3000 mailing list Python-3000@p

[Python-3000] yes to class decorators

2006-11-16 Thread tomer filiba
several things: [Josiah] > I believe that Tomer just wanted to remind people that class decorators > are slated for 2.6 and 3.0 if there was a PEP, and perhaps that he is > encouraging someone to write one. yeah, i just wanted to bring it up again. however, i do have some spare time at the moment

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Jack Diederich
On Thu, Nov 16, 2006 at 01:06:04AM +0200, tomer filiba wrote: [tomer filiba wrote stuff] I was hoping this thread would go unremarked but it looks like it is picking up some steam. So I'll throw in my two bits: Please for the love of god abandon this thread. It has been done. You weren't there

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Josiah Carlson
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > On 11/15/06, tomer filiba <[EMAIL PROTECTED]> wrote: > > i understand there's a green light for class decorators in py3k, > > so i wanted to give the issue a slight push. > > "Steven Bethard" <[EMAIL PROTECTED]> wrote: > > FWIW, most of the arguments

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Steven Bethard
On 11/15/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i understand there's a green light for class decorators in py3k, > so i wanted to give the issue a slight push. "Steven Bethard" <[EMAIL PROTECTED]> wrote: > FWIW, most of the arguments against PEP 359 were along the lines of, > "well you can

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Josiah Carlson
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > On 11/15/06, tomer filiba <[EMAIL PROTECTED]> wrote: > > i understand there's a green light for class decorators in py3k, > > so i wanted to give the issue a slight push. > FWIW, most of the arguments against PEP 359 were along the lines of, > "well yo

Re: [Python-3000] yes to class decorators

2006-11-15 Thread George Sakkis
tomer filiba wrote: > i'm not saying this particular example is useful, but i have > had many times when i thought "argh, i wish i had class > decorators for that". Same here, but like Steve, I'm not very optimistic this will be greeted with open arms. > sadly though, i don't remember many of t

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Steven Bethard
On 11/15/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i understand there's a green light for class decorators in py3k, > so i wanted to give the issue a slight push. If you haven't already, you should look at PEP 359, which tried to address many of the same use-cases and was withdrawn after feedb

[Python-3000] yes to class decorators

2006-11-15 Thread tomer filiba
i understand there's a green light for class decorators in py3k, so i wanted to give the issue a slight push. one problem with metaclasses is they are non-nestable, i.e., a function can be wrapped by a number of decorators, while classes can have only one metaclass. not only that, but metaclasses