[New-bugs-announce] [issue5042] Structure sub-subclass does not initialize with base class positional arguments

Jason R. Coombs report at bugs.python.org
Sat Jan 24 17:04:19 CET 2009


New submission from Jason R. Coombs <jaraco at jaraco.com>:

When trying to create a sub-subclass of a ctypes.Structure, the behavior
is not as expected.

An executable example that describes the problem in detail and
demonstrates the issue is available at
http://paste.turbogears.org/paste/29555 and also attached.

The failing behavior is near the beginning, following the description.

Three unsuccessful workarounds follow.

The expected behavior is found at the end, where a final workaround has
been implemented.

Can this behavior be improved in subsequent releases of ctypes?  If not,
can ctypes at least support the workaround natively (perhaps by
providing a method in the Structure class that performs the workaround
and can be called by a sub-subclass during __init__)?

----------
assignee: theller
components: ctypes
files: ctypes subclassing issues.py
messages: 80457
nosy: jaraco, theller
severity: normal
status: open
title: Structure sub-subclass does not initialize with base class positional arguments
type: behavior
versions: Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file12845/ctypes subclassing issues.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5042>
_______________________________________


More information about the New-bugs-announce mailing list