On 20 Dec 2007 19:50:31 -0800, Aahz <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Carl Banks <[EMAIL PROTECTED]> wrote:
> >On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote:
> >> In article <[EMAIL PROTECTED]>,
> >> Chris Mellon <[EMAIL PROTECTED]> wrote:
> >>>
> >>>You can reduc
In article <[EMAIL PROTECTED]>,
Carl Banks <[EMAIL PROTECTED]> wrote:
>On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote:
>> In article <[EMAIL PROTECTED]>,
>> Chris Mellon <[EMAIL PROTECTED]> wrote:
>>>
>>>You can reduce the size of new-style classes (inherit from object) by
>>>quite a bit if yo
On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
>
> Chris Mellon <[EMAIL PROTECTED]> wrote:
>
> >You can reduce the size of new-style classes (inherit from object) by
> >quite a bit if you use __slots__ to eliminate the class dictionary.
>
> You can also reduce
Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> Chris Mellon <[EMAIL PROTECTED]> wrote:
>>
>> You can reduce the size of new-style classes (inherit from object) by
>> quite a bit if you use __slots__ to eliminate the class dictionary.
>
> You can also reduce your functionality quite a bit by usi
In article <[EMAIL PROTECTED]>,
Chris Mellon <[EMAIL PROTECTED]> wrote:
>
>You can reduce the size of new-style classes (inherit from object) by
>quite a bit if you use __slots__ to eliminate the class dictionary.
You can also reduce your functionality quite a bit by using __slots__.
Someday I'll
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
>Aahz wrote:
>> In article <[EMAIL PROTECTED]>,
>> Steven Bethard <[EMAIL PROTECTED]> wrote:
>>>
>>> You can use __slots__ [...]
>>
>> Aaaugh! Don
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Well, I've read the thread, and I've read the thread it links to,
> and for the life of me I'm still no clearer as to why __slots__
> shouldn't be used except that:
[...]
> But is there actually anything *harmful* that can happen if I use
> __slots__?
Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> Steven Bethard <[EMAIL PROTECTED]> wrote:
>> You can use __slots__ [...]
>
> Aaaugh! Don't use __slots__!
>
> Seriously, __slots__ are for wizards writing applications with huuuge
> numbers of object i
Steven D'Aprano wrote:
> On Mon, 08 Oct 2007 15:15:36 +0200, Diez B. Roggisch wrote:
>
>>> Well, I've read the thread, and I've read the thread it links to, and
>>> for the life of me I'm still no clearer as to why __slots__ shouldn't
>>> be used except that:
>>>
>>> 1 Aahz and Guido say __slots
On Mon, 08 Oct 2007 15:15:36 +0200, Diez B. Roggisch wrote:
>> Well, I've read the thread, and I've read the thread it links to, and
>> for the life of me I'm still no clearer as to why __slots__ shouldn't
>> be used except that:
>>
>> 1 Aahz and Guido say __slots__ are teh suxxor;
>>
>> 2 rumou
Steven D'Aprano wrote:
> On Sun, 07 Oct 2007 21:27:31 -0700, Aahz wrote:
>
>> In article <[EMAIL PROTECTED]>, Steven
>> Bethard <[EMAIL PROTECTED]> wrote:
>>>
>>>You can use __slots__ [...]
>>
>> Aaaugh! Don't use __slo
On Sun, 07 Oct 2007 21:27:31 -0700, Aahz wrote:
> In article <[EMAIL PROTECTED]>, Steven
> Bethard <[EMAIL PROTECTED]> wrote:
>>
>>You can use __slots__ [...]
>
> Aaaugh! Don't use __slots__!
>
> Seriously, __slots__ are for wizards writi
On Oct 8, 12:27 am, [EMAIL PROTECTED] (Aahz) wrote:
>
> Aaaugh! Don't use __slots__!
+1 QOTW ;)
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
>
>You can use __slots__ [...]
Aaaugh! Don't use __slots__!
Seriously, __slots__ are for wizards writing applications with huuuge
numbers of object instances (like, millions of instances). For a
On 2006-08-27, Jacob Hallen <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Patrick Maupin <[EMAIL PROTECTED]> wrote:
>
> Unfortunately there is a side effect to slots. They change the behaviour of
> the objects that have slots in a way that can be abused by control freaks
> and stat
Dieter Maurer wrote:
> "Patrick Maupin" <[EMAIL PROTECTED]> writes on 26 Aug 2006 12:51:44 -0700:
> > ...
> > The only
> > problem I personally know of is that the __slots__ aren't inherited,
>
> "__slots__" *ARE* inherited, although the rules may be a bit
> complex.
Yes, I didn't write that corr
"Patrick Maupin" <[EMAIL PROTECTED]> writes on 26 Aug 2006 12:51:44 -0700:
> ...
> The only
> problem I personally know of is that the __slots__ aren't inherited,
"__slots__" *ARE* inherited, although the rules may be a bit
complex.
>>> class B(object):
... __slots__ = ('f1', 'f2',)
...
>>> cla
"Jacob Hallen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Unfortunately there is a side effect to slots. They change the behaviour
of
> the objects that have slots in a way that can be abused by control freaks
> and static typing weenies. This is bad, because the contol freaks s
Jacob Hallen wrote:
> Patrick Maupin <[EMAIL PROTECTED]> wrote:
> >Also, as I noted, I _do_ use them on occasion, so if there really _are_
> >potential pitfalls there, I would like to understand exactly what they
> >are, so my ears perk up whenever I notice a __slots__ discussion, but
> >so far I
In article <[EMAIL PROTECTED]>,
Patrick Maupin <[EMAIL PROTECTED]> wrote:
>I didn't actually sense any dander on your part, so it was probably a
>bit unfortunate that I chose to respond to that particular message. I
>do (rightly or wrongly) sense some dander on Aahz's part, and this was
>the secon
Patrick Maupin wrote:
> The only assertion that was made explicitly enough to be testable came
> about in a followup to Aahz's original post, only AFTER someone asked
> what the side-effects associated with __slots__ were. Aahz responded:
>
> > The main one is that inheritance becomes difficult t
Jarek Zgoda wrote:
> Having that said, should we hope __slots__ would disappear in (some)
> future (tomorrow?!, in next 10 microseconds?!)? Please, don't left us
> hopeless.
>
Are you saying you _do_ hope that __slots__ disappear? Why?
Regards,
Pat
--
http://mail.python.org/mailman/listinfo/p
[EMAIL PROTECTED] wrote:
> Aahz> Taking a look at __slots__ is fine as long as you don't actually
> Aahz> use them.
>
> Gabriel> Why?
>
> Skip>
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=
[EMAIL PROTECTED] napisał(a):
> That said, It's not mentioned on the Python3.0 page of the wiki:
>
> http://wiki.python.org/moin/Python3.0
>
> or in PEP 3000:
>
> http://www.python.org/dev/peps/pep-3000/
>
> and I see no discussion about it in the Python 3000 mailing list archives:
>
Aahz> Taking a look at __slots__ is fine as long as you don't actually
Aahz> use them.
Gabriel> Why?
Skip>
http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=2#f4ac2dfde32b16fd
Patrick>
[EMAIL PROTECTED] wrote:
> Aahz> Taking a look at __slots__ is fine as long as you don't actually
> Aahz> use them.
>
> Gabriel> Why?
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=2#f4ac2dfde32b16
[EMAIL PROTECTED] wrote:
> I think that the official python documentation has to become more like
> wikipedia, where people can fix it more easely, so I can add such
> warning into the text.
comment away:
http://pyref.infogami.com/
--
http://mail.python.org/mailman/listinfo/python-list
Aahz wrote:
> Taking a look at __slots__ is fine as long as you don't actually use them.
I remember the recent discussion about such matters... but I don't
understand its dangers fully still.
I assume __slots__ may be removed in Python 3.0, but maybe "experts"
need it now an then. Or maybe a "expe
Aahz> Taking a look at __slots__ is fine as long as you don't actually
Aahz> use them.
Gabriel> Why?
http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=2#f4ac2dfde32b16fd
Skip
--
http://mail.pyt
At Friday 25/8/2006 11:34, Aahz wrote:
>The results seem okay. Python is a dynamic language, object attributes
>(and methods, etc) are kept inside a dict, where you can add and remove
>them when you like. So using a dict is faster.
>You can also take a look at __slots__
Taking a look at __slots_
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>Andre Meyer:
>>
>> Is the test meaningful and are you surprised by the results?
>> I am, actually, because I would have assumed that attribute access
>> with an object should be faster because lookup can be precompiled.
>
>The results see
In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote:
>>Guido sez:
>>
>> __slots__ is a terrible hack with nasty, hard-to-fathom side
>> effects that should only be used by programmers at grandmaster and
>> wizard levels. Unfortunately it has gained an enormous undeserved
>Guido sez:
>
> __slots__ is a terrible hack with nasty, hard-to-fathom side
> effects that should only be used by programmers at grandmaster and
> wizard levels. Unfortunately it has gained an enormous undeserved
> popularity amongst the novices and apprentices, who should know
>
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>Aahz, citing Guido:
>>
>>__slots__ is a terrible hack with nasty, hard-to-fathom side
>>effects that should only be used by programmers at grandmaster and
>>wizard levels. Unfortunately it has gained an enormous undeserved
>
>I think I ha
Aahz, citing Guido:
>__slots__ is a terrible hack with nasty, hard-to-fathom side
>effects that should only be used by programmers at grandmaster and
>wizard levels. Unfortunately it has gained an enormous undeserved
I think I have used __slots__ just one time. Can you tell me some of of
such bad
In article <[EMAIL PROTECTED]>,
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>In <[EMAIL PROTECTED]>, Guyon Morée
>wrote:
>>
>> I'm using simple classes as a container of named values and I'm
>> instantiating a lot of them in a very short time.
>>
>> i was wondering if there is any benefi
In article <[EMAIL PROTECTED]>,
=?ISO-8859-1?Q?Sch=FCle_Daniel?= <[EMAIL PROTECTED]> wrote:
>
>does __slots__ nothing when used in derived classes?
Short answer: don't use __slots__ until you're comfortable writing
metaclasses and decorators. __slots__ are a p
37 matches
Mail list logo