[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Carlos Scheidegger
New submission from Carlos Scheidegger [EMAIL PROTECTED]: When creating ctypes.Structure classes dynamically, there's a gotcha. _fields_ is final, but it takes a list that can be appended to. I'm not sure this is a bug, but I would argue it is a lot more surprising than it could be: Python

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: 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. -- nosy: +amaury.forgeotdarc

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: 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

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Closing as won't fix. -- resolution: - wont fix status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2680 __