MatthieuDartiailh / pyclibrary

C parser and ctypes automation for python
http://pyclibrary.readthedocs.org
MIT License
66 stars 29 forks source link

Permit module reuse, remove init function #71

Open kalvdans opened 1 year ago

kalvdans commented 1 year ago

We have many Python modules that makes use of pyclibrary. Only one is allowed to call pyclibrary.init(). This issue is about removing the init() method and instead move its parameters to each CParser instance, to allow several uses of pyclibrary in one Python interpreter.

MatthieuDartiailh commented 1 year ago

Thanks for reaching out.

My bandwidth for this project is extremely limited. If you can make a PR I will review it under the best delay but I won't have time to at this myself.

kalvdans commented 1 year ago

I took a sunday afternoon to try to come up with a PR but got stuck in how nestled the global variables are. Even class Type is not the same in two configurations. The cache will incorrectly be reused in a different init configuration. The metaclass used for pluggable backends is hindering... I would probably make a PR to revert pluggable backends first.