In article <5a3a5737-f1b7-4419-9bb3-088c244a4...@c13g2000vbr.googlegroups.com>,
Carl Banks wrote:
>
>However, Aahz will be by shortly to tell you never to use slots.
Please note that there is an important distinction between "don't use
slots" and "never use slots" -- if you can locate any instan
On May 26, 9:55 pm, Carl Banks wrote:
> I don't want to sound to pessimistic about it, I really wouldn't mind
> a metaclass that makes slots more normal; but you have work to do.
Just as a minor followup, I'll mention that slots and inheritance have
some issues that aren't going to be resolvable
On May 26, 8:33 pm, Rebel Lion wrote:
> > I'd be ok with a metatype in the standard library that makes slots
> > more transparent, but since slots are intended as an optimization, it
> > doesn't really need (and might be detrimental to have) transparency
> > for ordinary objects.
>
> But why there
Rebel Lion wrote:
I'd be ok with a metatype in the standard library that makes slots
more transparent, but since slots are intended as an optimization, it
doesn't really need (and might be detrimental to have) transparency
for ordinary objects.
But why there is __slots__ if it's not indeed nee
> I'd be ok with a metatype in the standard library that makes slots
> more transparent, but since slots are intended as an optimization, it
> doesn't really need (and might be detrimental to have) transparency
> for ordinary objects.
>
But why there is __slots__ if it's not indeed needed. we sho
On May 26, 2:51 pm, geremy condra wrote:
> On Wed, May 26, 2010 at 1:50 PM, Carl Banks wrote:
> > On May 26, 5:49 am, Rebel Lion wrote:
> >> I made a metaclass to inherit __slots__ automatically.
>
> >> I think this feature should be included in builtin object's metaclass.
>
> > I'd be ok with a
On Wed, May 26, 2010 at 1:50 PM, Carl Banks wrote:
> On May 26, 5:49 am, Rebel Lion wrote:
>> I made a metaclass to inherit __slots__ automatically.
>>
>> I think this feature should be included in builtin object's metaclass.
>
> I'd be ok with a metatype in the standard library that makes slots
ss Bar():
bar = slot
Then replace
"isinstance(v,slot)" with "v is slot"
in the metaclass.
> Here is the metaclass:
>
> class slot(object):
> """Slot Decorator"""
>
> def __init__(self, func):
> pass
>
> c
;foo']
class Bar(Foo)
__slots__ = ['foo', 'bar']
Please discuss the pros & cons for this feature.
Here is the metaclass:
class slot(object):
"""Slot Decorator"""
def __init__(self, func):
pass
class SlotMe