ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
[ctypes-users] type conversion question
by Axel Seibert other posts by this author
Nov 5 2005 3:43AM messages near this date
[ctypes-users] Byte ordering | [ctypes-users] Can support for ctypes.com be dropped?
Dear Thomas & List!

Is this by design?

That's what I expect:

> >> from ctypes import *
> >> a=c_uint(0)
> >> a
c_ulong(0)

But the following not:
> >> class E(Structure): _fields_ = [('a', c_uint)]
... 
> >> e=E(0)
> >> e.a
0L
> >> e.a.__class__
<type 'long'> 

That gives problems e.g. When taking output from one DLL function and
feeding it as input to the next DLL function, as ctypes will complain that
it expected a ctypes data structure.

I'm not sure, why I stumbled across this only now... Or is there something I
am missing?

Thanx for any pointers!
Axel



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved