| ▲ | squeedles 13 hours ago | ||||||||||||||||
Had to write a fairly substantial native extension to Python a couple years ago and one of the things I enjoyed was that the details were not easily "Googleable" because implementation results were swamped by language level results. It took me back to the old days of source diving and accumulated knowledge that you carried around in your head. | |||||||||||||||||
| ▲ | davepeck 13 hours ago | parent | next [-] | ||||||||||||||||
I made some small contributions to cpython during the 3.14 cycle. The codebase is an interesting mix of modern and “90s style” C code. I found that agentic coding tools were quite good at answering my architectural questions; even when their answers were only half correct, they usually pointed me in the right direction. (I didn’t use AI to write code and I wonder if agentic tools would struggle with certain aspects of the codebase like, for instance, the Cambrian explosion of utility macros used throughout.) | |||||||||||||||||
| |||||||||||||||||
| ▲ | throwaway81523 5 hours ago | parent | prev | next [-] | ||||||||||||||||
There's a file on docs.python.org explaining the C api. The rest is pretty straightforward, at least until recently when free threading was introduced (IDK about now). Main hassle is manually having to track reference borrowing etc. Understandable in Python 2, but another tragedy in Python 3. | |||||||||||||||||
| ▲ | EdwardDiego 7 hours ago | parent | prev [-] | ||||||||||||||||
Great write up, thank you for sharing it! Quick question though, in your first code example (dynamic enum with a metaclass) what is "m" in this line towards the start?
Is it the metaclass? | |||||||||||||||||