Re: [Python-3000] iostack and Oh Oh

2006-12-09 Thread Josiah Carlson
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > For the sake of DRY, I'd prefer to see:: > > class MyMapping: > def mapping.__getitem__(self, key): > ... > def mapping.__len__(self): > ... I'd prefer to see... class MyMapping: @implements(ma

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Calvin Spealman
On 12/9/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > > At 08:53 AM 12/8/2006 -0600, Guido van Rossum wrote: > > > >>I've been thinking about this too, and I think it's reasonable to let > >>the metaclass provide the dict to be used as locals. > > > > [snip] > > > >>class C(B1, B2, metaclass=Foo): >

Re: [Python-3000] Assignment decorators

2006-12-09 Thread Jack Diederich
On Fri, Dec 08, 2006 at 11:58:38AM -0800, Brett Cannon wrote: > On 12/8/06, Talin <[EMAIL PROTECTED]> wrote: > > > >One other minor brainstorm before I head off to work: I'd like function > >decorators to work with assignment statements as well as 'def' statements. > > > >Use case: > > > >class

Re: [Python-3000] iostack and Oh Oh

2006-12-09 Thread Steven Bethard
On 12/9/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > I'd prefer to see... > > class MyMapping: > @implements(mapping) > def __getitem__(self, key): > ... > > @implements(mapping) > def __len__(self): > ... > [snip] > > P.S. Here's a 1

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Josiah Carlson
"Calvin Spealman" <[EMAIL PROTECTED]> wrote: > The obvious problem with a metaclass specific syntax is that it doesnt > allow for other things. Adding keyword options to class declarations > means you could do things beyond just metaclasses, such as interfaces, > if that happens. Right, but as is

Re: [Python-3000] iostack and Oh Oh

2006-12-09 Thread Josiah Carlson
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > On 12/9/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > I'd prefer to see... > > > > class MyMapping: > > @implements(mapping) > > def __getitem__(self, key): > > ... > > > > @implements(mapping) > > de

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Ronald Oussoren
On Dec 9, 2006, at 2:17 AM, Phillip J. Eby wrote: > At 01:20 PM 12/9/2006 +1300, Greg Ewing wrote: >> Talin wrote: >>> In other words, the >>> __metaclass__ statement would have a side-effect of replacing the >>> locals() dict with a mapping object supplied by the metaclass. >> >> __metaclass__ i

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Phillip J. Eby
At 09:01 PM 12/9/2006 +0100, Ronald Oussoren wrote: >On Dec 9, 2006, at 2:17 AM, Phillip J. Eby wrote: > > The principal hurdle that would need to be overcome to do this, is > > that you > > can't change a builtin type's __class__ currently: > >Another hurdle is that you can add slots the the type

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Michel Pelletier
> From: Greg Ewing <[EMAIL PROTECTED]> > How about > >class C(B1, B2) is M: > ... +1 -Michel PS Please excuse me for my last email's digest subject. ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinf

Re: [Python-3000] Python-3000 Digest, Vol 10, Issue 22

2006-12-09 Thread Michel Pelletier
Guido: > > class C(B1, B2, metaclass=Foo): +1 Talin: > >> This would allow the metaclass to intercept individual variable > >> assignments as they occur, rather than taking the whole dict in at once. +10! Guido: > > How can we design this feature without yet another gigantic > > contentious th

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Greg Ewing
Calvin Spealman wrote: > The obvious problem with a metaclass specific syntax is that it doesnt > allow for other things. Please, let's not hypergeneralise. I would hate to see the class header get cluttered up with unbounded quantities of extra stuff. -- Greg ___

Re: [Python-3000] Metaclasses in Py3K

2006-12-09 Thread Greg Ewing
Josiah Carlson wrote: > class FooClass(X, Y, implements=sequence): No, no, no, no, no. This is just the sort of thing I'm afraid of. "Implements equals" is an abomination against the English language. -- Greg ___ Python-3000 mailing list Python-30