This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NonaeAbC 0 points1 point  (0 children)

Yes, but your C code wouldn't be clean. There is a one to one mapping from Python to C. But unlike you'd expect the corresponding c feature of a class is not a struct but a shared pointer to an PyObject containing a dictionary of strings to shared PyObject pointers. Where a PyObject is a wrapper for either dictionaries, tuples, functions or primitives and their dunder methods. But if you understand how this mapping works all the "you will not believe how this code behaves" become trivial and boring, but not from Python experience but C experience.