mypyc questions #4
-
Hello. Enjoyed reading and learning from the 3-part mypyc and Black posts. I have a few questions: i. Does mypyc handle external libraries, specifically those built with C like numpy, well? ii. If Python code includes existing C-extensions (for certain functions) then does mypyc handle them well? iii. Is there a place to ask mypyc related questions but is not SO? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey thanks for reading my blog series, I appreciate the kind words!
Probably...? Black uses typed-ast to parse Python code into an AST on Python 3.7 and below (IIRC?) which is a CPython C Extension and I haven't encountered any weird issues calling to non-mypyc extension code from mypyc code and vice versa yet. In general, I'd assume things should be fine since mypyc would use standard C-APIs to interact with the objects, functions, and classes from external libraries (regardless if it's in C or Python).
I have no idea. I haven't worked with C-extensions before (other than the ones mypyc generate obviously :P). I'm currently learning C so I'd like to write my own C-extensions eventually, but until then I really just don't know.
I have connections to some of the folks who know / work on mypyc so I haven't looked for a place yet, but I'd assume https://gitter.im/python/mypy is your best bet, looks pretty dead though :( |
Beta Was this translation helpful? Give feedback.
Hey thanks for reading my blog series, I appreciate the kind words!
Probably...? Black uses typed-ast to parse Python code into an AST on Python 3.7 and below (IIRC?) which is a CPython C Extension and I haven't encountered any weird issues calling to non-mypyc extension code from mypyc code and vice versa yet. In general, I'd assume things should be fine since mypyc would use standard C-APIs to interact with the objects, functions, and classes from external libraries (regardless if it's in C or Python).