-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace pythonic type
for representing a pointer with _weakref.ref
or something better named.
#148
Comments
Support for |
Commit 6b91323 adds the ability to destructively assign a |
Commit e2d094f adds support for variable-length structures (specified as a tuple of the type and size), and also adds the various string types of different widths and length-prefixes (specified as a tuple of |
type
for representing a pointer with _weakref.ref
or similar.type
for representing a pointer with _weakref.ref
or something better named.
Maybe it'd be a better idea to use |
I've settled on Nobody cares about this anyways, so this issue is being closed. |
The pythonic types component could be reworked a bit to clean up the atoms (or types) that are used. Instead of using
type
for a reference, orchr
for a character we can allow for more types or use things that are more clear.We currently have
[chr, length]
for an array of characters and essentiallystr
is just an alias for that. However, we can usestr
with the form(str, widthtype, lengthtype)
to specify a particular type of string.As prior noted, we use
type
to note a reference (pointer) but it would be more clear if we dual-use theweakref
type that you find in_weakref.ref
. This could also be used like(_weakref.ref, 4)
to specify auint32_t
-sized pointer. We'd also need to expose_weakref.ref
by importing it into the global namespace so that users could access it asref
orreference
when assigning their types.It'd be nice to figure out a type that lets you specify an enum used for a particular type. This would be vastly different because the way we're specifying structures is by wrapping them with a python object. There's a list of builtin modules that can be scraped for relelvant types in the
sys.builtin_module_names
tuple.The text was updated successfully, but these errors were encountered: