flacjacket / pywayland

Python bindings for the libwayland library
Apache License 2.0
79 stars 16 forks source link

Add wl_container_of and wl_list_for_each utility functions #23

Closed m-col closed 3 years ago

m-col commented 3 years ago

This adds functions in pywayland.utils that mirror the wl_container_of and wl_list_for_each macros in wayland-util.h.

m-col commented 3 years ago

Getting a weird mypy error:

pywayland/utils.py:83: error: Name 'ffi.CData' is not defined

I can access this on my machine. The ffi_build.py script is run during the mypy check, right?

flacjacket commented 3 years ago

Getting a weird mypy error:

pywayland/utils.py:83: error: Name 'ffi.CData' is not defined

I can access this on my machine. The ffi_build.py script is run during the mypy check, right?

I think all of the _ffi types are hand-annotated in pywayland/_ffi.pyi, and there I had written Cdata rather than CData. It might be that I had done the capitalization incorrectly and that is causing the problems. Does it work if you change the pyi file?

m-col commented 3 years ago

I added a commit to change Cdata to CData everywhere but the mypy complaint still persists oddly. Any ideas?