Good readable syntax, strong built-in data structures, good libraries for just about everything, less "magic" than other similar languages, moves at a deliberate pace and values backwards compatibility (minus the 2->3 thing).
It works well,is not handicapped by verbose idioms, works on most platforms and environments, can glue together other technologies, and the community is pretty good.
Scales small-to-medium codebases well. Modules and packages work well. PEP8. Linting tools like flake8.
Documentation is top tier. Docutils + Sphinx + ReadTheDocs. Autodoc and intersphinx (linking across python projects) are just wonderfully implemented.
Contrib Library quality. Mature and well documented. Permissively licensed. Django, SQLAlachemy, Requests, Flask, Werkzeug, Boto, Jupyter, Numpy, Pandas, Scipy, fabric, ansible, saltstack, pytest (a new favorite of mine).
Standard library quality. Well documented and just the right amount of features in many cases. In some situations you may find more elegant API's in the contrib community.
OOP is implemented nicely. It scales well. It's easy to traverse large codebases and get situational orientation fast.
Language consistency. Python 3 is generally a consistent language. There are warts in every language, but nothing in python is insurmountable. Python 2.7 with __future__ imports and a compat module eliminates a lot of problems.
Debugging: Tracebacks are human friendly. ptpython/ptpdb and ipython/ipdb are a delight to work with.
C API integration. Well documented and well supported. Also see Cython, CFFI. Also C++ with boost python and pybind11
Editor integration. Jedi, pycharm
Stability. CPython (the main implementation) doesn't break. Clear distinction between 2 and 3 and easy enough to code to both versions. Contrib libraries generally follow semver and have consistent API's
Community. Friendly and great support on IRC and so on.
Short answer: Python is the best high-level, general purpose language. It's got a good following in web apps and APIs, data processing and research, and many other fields, as well as being the language of choice for many glue code projects and as a modern alternative to bash scripts.
I wrote a post that was popular on HN a few years ago thinking out loud about what Python is good at which received several comments on areas I missed too. The link in the HN thread [1] is dead but you can find the post at [2].
It's mature. The community is mature (in multiple senses of the word). The ecosystem is mature. The package management is solid. There are drivers or SDKs for basically every tool or service I would want to interface with.
The syntax is rich but concise. It doesn't require compilation of binaries. It does OOP pretty well. It does procedural pretty well. It does web pretty well. It does throwaway command line scripts pretty well. It does performance well enough for the things I do with it. It's portable.
Python isn't perfect, but 99.99% of the time it gets out of my way. I must, can, and do work with other languages. I constantly find them frustrating me in small ways. Python generally doesn't do that.
For business automation it's spectacular. Pandas dataframes make database queries and dynamic reporting easy. There are rich API examples for most services. It's free. It's portable between osx, Linux and windows.
>as the life of the sane language version (Python 2) is going to end at some point.
Don't hold your breath for that. There are tens (hundreds?) of millions of Python code in production that's nobody ever gonna port, and that people will still support well into 2040.
My point was that Python written by someone that don't know how to write readable code is just as unreadable as "sysadmin" Perl. Well written Perl is actually very readable.
I use Python because of the people who made it what it is today. The community is what I like most about Python.
I'm bootstrapping, taking a one-man army approach to creating a new service. I chose a mature language with features and open source projects I may possibly want or need along the way. I am working alone -- not by preference but rather necessity -- and knew I would need help along the way (started very green, 4 years ago). The Python standard library and open source ecosystem offers everything and more than I may ever need to create my vision. The Python community is really strong. It's a global movement. I've gotten so much help on IRC! Stack overflow always has an answer or a legion ready to answer practically anything Python related. Years of Python related blog posts are a google search away from access. PSF-supported Python conferences release or at least try to release video recordings of talks (cough.. ehem..). As for conferences? PyCon has been the ooey gooey salted caramel center of the perfect vanilla pint.
The wide number of things it enables: data science & machine learning, web apps & APIs, simple scripts, and it doesn't trip beginners up with extra syntax.
It fits in my head. Its concepts are simple but orthogonal and extremely powerful. It doesn't ask me to take up complicated abstractions in order to do complicated things.
There's a library for everything out there.
I have never seen a language with greater uniformity of styles and idioms, with those style choices being right the vast majority of the time. You generally know what to expect, and I spend little time fighting with bugs or surprising behaviors.
For the things where its performance is unsatisfactory, it offers escape hatches. The tooling is good; there's better out there but I rarely find myself yearning for more than ipdb.
For scientific computing, it's simply top notch. I can't see myself using anything else for doing my data analysis until you're pushing the limits of performance.
Tracebacks are clear. Unlike JS, I know exactly where a piece of code is failing.
It lets you break rules when you need it to but it makes it obvious and the cultural pressure to not do it is high. Out of all the dynamically typed languages I know it'd the one I feel most comfortable pushing until the point where you need stronger validation.
40 comments
[ 0.18 ms ] story [ 102 ms ] threadI just wish it supported the functional paradigm.
I love python. An ancient mess.
Documentation is top tier. Docutils + Sphinx + ReadTheDocs. Autodoc and intersphinx (linking across python projects) are just wonderfully implemented.
Contrib Library quality. Mature and well documented. Permissively licensed. Django, SQLAlachemy, Requests, Flask, Werkzeug, Boto, Jupyter, Numpy, Pandas, Scipy, fabric, ansible, saltstack, pytest (a new favorite of mine).
Standard library quality. Well documented and just the right amount of features in many cases. In some situations you may find more elegant API's in the contrib community.
OOP is implemented nicely. It scales well. It's easy to traverse large codebases and get situational orientation fast.
Language consistency. Python 3 is generally a consistent language. There are warts in every language, but nothing in python is insurmountable. Python 2.7 with __future__ imports and a compat module eliminates a lot of problems.
Debugging: Tracebacks are human friendly. ptpython/ptpdb and ipython/ipdb are a delight to work with.
C API integration. Well documented and well supported. Also see Cython, CFFI. Also C++ with boost python and pybind11
Editor integration. Jedi, pycharm
Stability. CPython (the main implementation) doesn't break. Clear distinction between 2 and 3 and easy enough to code to both versions. Contrib libraries generally follow semver and have consistent API's
Community. Friendly and great support on IRC and so on.
I wrote a post that was popular on HN a few years ago thinking out loud about what Python is good at which received several comments on areas I missed too. The link in the HN thread [1] is dead but you can find the post at [2].
[1]: https://news.ycombinator.com/item?id=9524607
[2]: http://web.archive.org/web/20161101070610/http://lisnr.com/b...
The syntax is rich but concise. It doesn't require compilation of binaries. It does OOP pretty well. It does procedural pretty well. It does web pretty well. It does throwaway command line scripts pretty well. It does performance well enough for the things I do with it. It's portable.
Python isn't perfect, but 99.99% of the time it gets out of my way. I must, can, and do work with other languages. I constantly find them frustrating me in small ways. Python generally doesn't do that.
Don't hold your breath for that. There are tens (hundreds?) of millions of Python code in production that's nobody ever gonna port, and that people will still support well into 2040.
Care to post a sample?
And even if it actually was unreadable, just consider how the equivalent would look in Perl, or C (or APL...).
I'm bootstrapping, taking a one-man army approach to creating a new service. I chose a mature language with features and open source projects I may possibly want or need along the way. I am working alone -- not by preference but rather necessity -- and knew I would need help along the way (started very green, 4 years ago). The Python standard library and open source ecosystem offers everything and more than I may ever need to create my vision. The Python community is really strong. It's a global movement. I've gotten so much help on IRC! Stack overflow always has an answer or a legion ready to answer practically anything Python related. Years of Python related blog posts are a google search away from access. PSF-supported Python conferences release or at least try to release video recordings of talks (cough.. ehem..). As for conferences? PyCon has been the ooey gooey salted caramel center of the perfect vanilla pint.
There's a library for everything out there.
I have never seen a language with greater uniformity of styles and idioms, with those style choices being right the vast majority of the time. You generally know what to expect, and I spend little time fighting with bugs or surprising behaviors.
For the things where its performance is unsatisfactory, it offers escape hatches. The tooling is good; there's better out there but I rarely find myself yearning for more than ipdb.
For scientific computing, it's simply top notch. I can't see myself using anything else for doing my data analysis until you're pushing the limits of performance.
Tracebacks are clear. Unlike JS, I know exactly where a piece of code is failing.
It lets you break rules when you need it to but it makes it obvious and the cultural pressure to not do it is high. Out of all the dynamically typed languages I know it'd the one I feel most comfortable pushing until the point where you need stronger validation.