A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-October/069683.html below:

Adding data-type objects to Python

[Python-Dev] PEP: Adding data-type objects to Python [Python-Dev] PEP: Adding data-type objects to Python"Martin v. Löwis" martin at v.loewis.de
Tue Oct 31 08:51:25 CET 2006
Travis Oliphant schrieb:
> So, the big difference is that I think data-formats should be 
> *instances* of a single type.

This is nearly the case for ctypes as well. All layout descriptions
are instances of the type type. Nearly, because they are instances
of subtypes of the type type:

py> type(ctypes.c_long)
<type '_ctypes.SimpleType'>
py> type(ctypes.c_double)
<type '_ctypes.SimpleType'>
py> type(ctypes.c_double).__bases__
(<type 'type'>,)
py> type(ctypes.Structure)
<type '_ctypes.StructType'>
py> type(ctypes.Array)
<type '_ctypes.ArrayType'>
py> type(ctypes.Structure).__bases__
(<type 'type'>,)
py> type(ctypes.Array).__bases__
(<type 'type'>,)

So if your requirement is "all layout descriptions ought to have
the same type", then this is (nearly) the case: they are instances
of type (rather then datatype, as in your PEP).

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4