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 kermode
Recipients
Date 2006-11-17.21:26:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Ctypes version 1.0.1 and Python 2.4:

A Partially declared structure can be used as a type
in its own field declarations:

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> from ctypes import Structure, c_int, sizeof, __version__
>>> __version__
'1.0.1'
>>> class S(Structure):
...     pass
...
>>> S._fields_ = [('i', c_int), ('s', S)]
>>> sizeof(S)
4
>>> o=S(7)
>>> o.s.i=12
>>> o.s.s.i=20
>>> o.i
7
>>> o.s.i
12
>>> o.s.s.i
20
>>> sizeof(o)
4
History
Date User Action Args
2007-08-23 14:49:58adminlinkissue1598620 messages
2007-08-23 14:49:58admincreate