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

2009-09-18 Thread Thomas Heller
Changes by Thomas Heller : -- resolution: -> fixed status: open -> closed versions: -Python 2.5 ___ Python tracker ___ ___ Python-bug

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

2009-09-18 Thread Thomas Heller
Thomas Heller added the comment: I've commited a slightly changed patch plus a test. trunk: 74917, py3k: 74918, release26-maint: 74919, release31-maint: 74920. -- ___ Python tracker ___

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

2009-09-18 Thread Thomas Heller
Thomas Heller added the comment: > Is that any help? Not really ;-). Here is a patch I just wrote - it must still be checked for correctness, and tests for it must be added. I hope the comment in the code explains how it works. ctypes-structinit.patch -- keywords: +patch Added file:

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

2009-09-17 Thread Jason R. Coombs
Jason R. Coombs added the comment: That was easier than I thought. The generated code is _ugly_ but it did seem to be able to generate it. I created init.pyx {{{ class X(object): def __init__(self, *args, **kw): """This is how the Structure's __init__method SHOULD be"""

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

2009-09-17 Thread Jason R. Coombs
Jason R. Coombs added the comment: Heh. Me neither. Is it possible to use something like Cython to generate the C code? -- ___ Python tracker ___ __

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

2009-09-17 Thread Thomas Heller
Thomas Heller added the comment: The problem is the implementation of the current __init__ method, in Modules/_ctypes/_ctypes.c, line 4024. Rewritten in Python, and slightly simplified it looks like this: def __init__(self, *args, **kw): """The current BUGGY __init__ method"""

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

2009-09-17 Thread Thomas Heller
Changes by Thomas Heller : -- versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mai

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

2009-01-24 Thread Jason R. Coombs
New submission from Jason R. Coombs : 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