Skip to content
Advertisement

What is “Pure Python?”

Many questions on Stack Overflow refer to “Pure Python” (some random examples from the “similar questions” list: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).

I also encounter the concept elsewhere on the web, e.g. in the package documentation for imageio and in tutorials such as “An introduction to Pure Python”.

This has led me to believe there must be some universally accepted standard definition of what “Pure Python” is.

However, despite googling to the limits of my ability, I have not yet been able to locate this definition.

Is there a universally accepted definition of “Pure Python,” or is this just some elusive concept that means different things to different people?

To be clear, I am asking: Does such a definition exist, yes or no, and if so, what is the acclaimed source? Although I truly appreciate all comments and answers, I am not looking for personal interpretations.

Advertisement

Answer

In that imageio package, they mean it’s all implemented in Python, and not (as is sometimes done) with parts written in C or other languages. As a result it’s guaranteed to work on any system that Python works on.

In that tutorial, it means the Python you get when you download and install Python — the language and the standard libraries, not any external modules. The chapter after that adds some external libraries, like numpy and scipy, that are used a lot but aren’t part of the standard library.

So they mean different things there already.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement