This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author theller
Recipients amaury.forgeotdarc, cscheid, theller
Date 2008-04-24.17:54:06
SpamBayes Score 0.030881792
Marked as misclassified No
Message-id <4810C937.1040801@ctypes.org>
In-reply-to <1209058977.78.0.362619100484.issue2680@psf.upfronthosting.co.za>
Content
> The __slots__ member of a class object has the same behavior.
> You may mutate it (even replace it) but this has no effect: only the
> value available when the "class" statement was executed is relevant.

The rules in ctypes are a little bit more complicated (but thanks for the
__slots__ example, Amaury):

The _fields_ sequence is used when the class statement is executed (if
_fields_ are given), or when _fields_ are assigned to the class.
The third case appears when an instance of a structure class without _fields_
is actually *used*: by creating an instance of the class, by using the
class in another structure _fields_ definition; in this case the structure class
is built with an empty _fields_ list.

To answer the OP quetsions:  Yes, disallowing lists as _fields_ would break
too much code.  Also, I think tuples in lists are easier to read than nested tuples.
History
Date User Action Args
2008-04-24 17:54:08thellersetspambayes_score: 0.0308818 -> 0.030881792
recipients: + theller, amaury.forgeotdarc, cscheid
2008-04-24 17:54:07thellerlinkissue2680 messages
2008-04-24 17:54:06thellercreate