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.
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).
Lots of great answers here, but I think that there is an underlying cause of most of the benefits described, and that there is "one obvious way" to think about this question, and it's this:
* Python lives outside the control of any single corporate or government entity. Yes, three of the biggest players work at Dropbox, but clearly Dropbox doesn't have the kind of control over Python that Oracle has over Java, SalesForce with Ruby, or Google with Go.
Because of this, Python is more a community than a single programming language. Being at PyCon fills one with the sense that, after the fall of the state (or at least the US government), very little will change within Python - we'll still be there to support each other in code and in spirit.
There will still be a space for data science and web trends to share air with multimedia hacking and sacred geometry. There will still be story telling, acro-yoga, robotics, and unit tests under one roof.
I can actually imagine Rust or Go (and Gophercon) becoming such a haven, but to my knowledge, it isn't yet. Python has the unique combination of a rich, diverse, radical, accepting culture with technical maturity and reliability.
Python makes me feel safe and brings out the best of who I am.
It's a top-tier language due to the amazing support it receives from companies and the community. The PSF is well organized and the language releases are stable. There aren't a massive number of releases (or security issues) to try and keep up with but enough where new features are being added. It's usually one of the first languages to receive love when a new service is rolled out in terms of a library or offering. Tooling is good, using Visual Studio Code.
It's on an uptrend on usage which is always good for your career. I use it for web apps and API's and many larger companies also use it like Uber, Rackspace, Twillio, etc. The scientific field is becomming larger and it seems to be growing extremely quick with a new momentum in AI. Great option for building a CLI tool out. Overall it can handle a lot.
It's a language I really enjoy using on a daily basis at work. It feels like it has been the result of lots of hard work from some really smart people. Our team was at a crossroads and tried a variety of languages, we all agreed on Python. Clarity of what's happening with code is important to us and Python excels in this area.
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.
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.
- it looks enough like pseudo-code that translating what I wrote on paper into a program is that much simpler.
The fact that it can be used both for teaching computer science in colleges and children how to code speaks volumes about its versatility and approachability.
I use it mostly for web apps, APIs and miscellaneous scripts. Python has been a great addition to my tool-belt. There are some languages I hope I never have to write again; Python on the other hand is something I'm going to always keep in mind, even if I spend most of my days writing another language.
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.
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.
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.
>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.
git-pull|9 years ago
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.
tedmiston|9 years ago
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...
cauterized|9 years ago
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.
mattbillenstein|9 years ago
jMyles|9 years ago
* Python lives outside the control of any single corporate or government entity. Yes, three of the biggest players work at Dropbox, but clearly Dropbox doesn't have the kind of control over Python that Oracle has over Java, SalesForce with Ruby, or Google with Go.
Because of this, Python is more a community than a single programming language. Being at PyCon fills one with the sense that, after the fall of the state (or at least the US government), very little will change within Python - we'll still be there to support each other in code and in spirit.
There will still be a space for data science and web trends to share air with multimedia hacking and sacred geometry. There will still be story telling, acro-yoga, robotics, and unit tests under one roof.
I can actually imagine Rust or Go (and Gophercon) becoming such a haven, but to my knowledge, it isn't yet. Python has the unique combination of a rich, diverse, radical, accepting culture with technical maturity and reliability.
Python makes me feel safe and brings out the best of who I am.
That's why I use Python.
cdnsteve|9 years ago
It's on an uptrend on usage which is always good for your career. I use it for web apps and API's and many larger companies also use it like Uber, Rackspace, Twillio, etc. The scientific field is becomming larger and it seems to be growing extremely quick with a new momentum in AI. Great option for building a CLI tool out. Overall it can handle a lot.
It's a language I really enjoy using on a daily basis at work. It feels like it has been the result of lots of hard work from some really smart people. Our team was at a crossroads and tried a variety of languages, we all agreed on Python. Clarity of what's happening with code is important to us and Python excels in this area.
Daishiman|9 years ago
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.
Dowwie|9 years ago
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.
type0|9 years ago
oyebenny|9 years ago
theophrastus|9 years ago
HD134606c|9 years ago
arms|9 years ago
- it's a well designed language
- it has a great ecosystem and community
- it runs fast (enough for my purposes)
- it looks enough like pseudo-code that translating what I wrote on paper into a program is that much simpler.
The fact that it can be used both for teaching computer science in colleges and children how to code speaks volumes about its versatility and approachability.
I use it mostly for web apps, APIs and miscellaneous scripts. Python has been a great addition to my tool-belt. There are some languages I hope I never have to write again; Python on the other hand is something I'm going to always keep in mind, even if I spend most of my days writing another language.
rrggrr|9 years ago
sparkling|9 years ago
pryelluw|9 years ago
I just wish it supported the functional paradigm.
meagher|9 years ago
PaulHoule|9 years ago
paultopia|9 years ago
marchenko|9 years ago
LordHeini|9 years ago
drewjaja|9 years ago
ransom1538|9 years ago
I love python. An ancient mess.
BoysenberryPi|9 years ago
loblollyboy|9 years ago
apetrov|9 years ago
slrz|9 years ago
rajathagasthya|9 years ago
coldtea|9 years ago
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.
sumedh|9 years ago
jmstfv|9 years ago
rtiwary|9 years ago
jwilk|9 years ago
vgy7ujm|9 years ago
brogrammernot|9 years ago
coldtea|9 years ago
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...).
jeffjose|9 years ago