r/learnpython • • Jan 03 '25

Are extensions like Cython really turn Python into a compiled language?

I was chatting with chatGPT the other day and he told me about compiled and interpreted languages. He’s also told me about extensions like Cython that aim to make your Python code compiled. So, I was wondering if they really give your code the benefits of compiled languages or they work in a different way

P.s. I apologize in advance if my question makes no sense. I’ve never dealt with compiled languages and I have vague knowledge about them

0 Upvotes

13 comments sorted by

View all comments

2

u/[deleted] Jan 03 '25

Cython is a superset of python which does compile to c, if you're looking to run some c code or wanting to speed up your python code significantly then definitely look into cython.

It allows you to write in a python and c hybrid language with nearly all the features of both languages. Only downside is it also has the drawbacks of making code much harder to debug and write.

Cython requires cpython to run the cython modules but if you combine with a python compiler such as nuitka you can remove this dependency