"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
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):
>
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
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
"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
"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
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
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
> 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
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
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
___
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
12 matches
Mail list logo