Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] The State of Python in 2021 (deprogrammaticaipsum.com)
30 points by ingve on Aug 2, 2021 | hide | past | favorite | 51 comments



There are quite a few inaccuracies here.

Guido is now working on Python performance at Microsoft and is not the BDFL anymore. Instead, there is a five-person Steering Council overseeing Python.

The best C/C++ interaction options include Cython, cffi, and pybind11. None of those are mentioned. I don't know anybody still recommending SWIG.

No mention for FastAPI or asyncio is a big omission in the Web backend use case. Relatedly, the article still recommends Requests when the community is largely moving to httpx which supports both blocking and async networking.

For packaging, the author mentions and links to Conan (a C++ package manager) which sounds like he misheard Conda.

He's also saying that the easiest way to get Python on Windows is chocolatey. Well, if you type "python" into a command prompt on a fresh install of Windows, it will take you to the Windows Store where you can install the latest Python release with one click. For many users this gotta be easier than figuring out chocolatey.

There is no discussion on "Python, the language" and its state in 2021. I was looking forward to a discussion on that.

I don't mean to pile on but the definitive title sounded like we'd get something pretty authoritative. This ain't that.


Relatedly, the article still recommends Requests when the community is largely moving to httpx which supports both blocking and async networking.

And is still in beta. It's got potential, not least because it borrows much of what makes requests good, but "the community is largely moving to httpx" is a stretch.


At 4.2 million downloads per month, it's not exactly a prototype toy either.


I don't know where that figure came from or what it tells us. Looking at the PyPI stats for httpx and requests, the latter remains much higher across the board for now.

None of that is important anyway. Requests is an excellent library. Httpx appears to be becoming another excellent library and a natural successor. I'm just saying we shouldn't overhype something new before it's ready. Running beta dependencies in production is a risky business.


Thanks for the httpx info. Im still using requests but have been looking for a none-blocking option.

With regards to installing via the windows store, I've been told by others in various programmer communities that this isn't the best idea. It doesn't add things to the PATH properly and is a pain to sort out.

I either install it from the python website or using scoop.


The author clearly isn't as well informed as he thinks himself to be. And what a smug jab at Django... Better refer his blogpost to the dumpster where it belongs.


This doesn't say a lot about the current state of Python. It's just a list of the libraries that the author happens to know. Presented not in list form.


A couple notable omissions:

Guido now works at Microsoft.

pybind11 is probably the latest and greatest for C++ interop.


+1 for pybind11


> At some point I got a job as a Django application developer, a framework pompously marketed “for perfectionists with deadlines”; a punchline filled with hubris and undeserved merit. Thankfully these days Cloud Native Python apps are built around less monolithic options such as Flask, Pyramid, or Tornado.

If your app grows big enough, you'll end up badly re-implementing Django in Flask. Django is far from perfect, but this blanket dismissal just sounds smug.


[flagged]


And you seem to overestimate the quality of your overly aggressive comment, since you copy and paste it several times.


That's harsh. I do think he is very wrong and ignorant, but there is no need to be upset about it.

The article is not without interest for someone who don't see the python ecosystem regularly.

I hope you didn't flag the article for that.


Every now and then I consider revisiting Python (I haven't used it in anger for a few years), but I am continually put off by the wild-west state of dependency management, lack of standard tooling and project configuration.

Python's goal that "there should be one obvious way to do anything" is admirable, but doesn't seem like it's lived up to in any way.

Say what you will about Golang, but I do like the fact that it won't even compile if you don't follow the mandated codestyle. I don't want to have to think about stuff like that when I have actual problems to think about.


> Python's goal that "there should be one obvious way to do anything" is admirable, but doesn't seem like it's lived up to in any way.

I don't think that was ever a serious goal, it's just that initially Python competed with Perl, and Perl's slogan was "There's More Than One Way To Do It". Python didn't have as many different ways of doing the same thing in the language itself, and Python people liked that, so its slogan became the opposite.

Since Python 2 and 3 there are already far more different ways to do things in the language (like several ways of string formatting, etc) so it's more of a historical thing. And it was never the case for tooling.


This is rewriting history. It was a serious goal at the time, and the language was all the better for it; the fact that it wasn't applied to tooling is the language's gravest mistake.


Maybe, but I have trouble thinking of a Python language decision that was made (or not made) because there should be a single way to do things. Can you think of one?


Pushing map/reduce/filter behind an import was done on the grounds that list comprehensions were the preferred way to express the same things.


Pip is standard for dependency management, but that didn’t stop others from building alternatives.

I don’t find there to be a lack of standard tooling. Rather, there’s too many options to choose from you might say. It’s what success looks like, I guess.


Well python is old and doesn't have a lot of funding, Go is young and is backed by google.

I do expect that the state of dependancy management is going to change in the next few years because:

- MS has entered the game

- PEP are being worked on a lot on packaging lately

- shiv, briefcase and nuitka are getting traction

- poetry and dephell are very qualitative tools

- __pypackages__ is on the way (try it with pdm)

- pyflow show a very interesting approach to installing python

- python 2 is dead for good

- wheels are now ubiquitous


> Thankfully these days Cloud Native Python apps are built around less monolithic options such as Flask, Pyramid, or Tornado.

FastAPI is also a very popular choice these days, arguably more so than Pyramid and Tornado.


One thing I didn't see mentioned is profiling. I'm really interested in the recently released Scalene tool: https://pypi.org/project/scalene/, which seems to be a top contender to replace all the previous tools.


I use scalene, it's great. py-spy is good too for more real-time use


I don't see the black python formatter[0] mentioned. I use it for all of my projects and I love it as I prefer not to have a linter distract me while I type. You can see a demo[1] without installing it to check how it works.

[0] https://github.com/psf/black

[1] https://black.vercel.app/


Some additional "State of Python"-themed material:

https://www.jetbrains.com/lp/devecosystem-2021/python/

https://www.jetbrains.com/lp/python-developers-survey-2020/ (in partnership with PSF)


> I still facepalm every time I type quit in the REPL and get the tone-deaf "Use quit() or Ctrl-D (i.e. EOF) to exit" message instead.

Yeah what is up with that? Just quit if there's no variable called "quit". Nobody will care that the REPL doesn't give the exact right behaviour for one case.

Hell, make `quit` a keyword if you have to.

Anyway, I really want to like Python but three things make me hate it:

1. The miserable state of type checking.

2. The miserable performance.

3. The miserable project management situation.

Deno/Typescript fixes all of those in my book so I use that where possible. It's better than Python in almost every way.


I'll risk giving an impression of being set in my superior ways: just type Ctrl-D as it suggests? It works for every readline-like environment, like shell, ssh session, redis cli, and so on.


In my office, everyone seems to avoid python like fire. The big reason seems to be that lack of static type checking makes their work harder in the long run.


Python is no Haskell but type hints does reach Pareto level for catching bugs. Mypy is now well integrated into IDE so no reason to have a type error anymore.

I will switch to python 3.10 as soon as it's released just for the better error messages and the typing goodies though.


I was going to object that one reason for not using static typing is that certain perfectly reasonable patterns are difficult to describe to the type checker, e.g. sharing tests between TestCase classes by using a mix-in – but apparently[1] Python 3.8 solved that particular case.

[1] https://stackoverflow.com/a/60323489/896841


Apparently the type hints don't work because people don't use them in libraries.


This is true. But it doesn't necessarily make Python bad. It's just not the right tool for the job.

I love Python (I consider it my main language), but there are a ton of use cases for which I wouldn't use it for. Namely, if you need: robustness (provided by static typing, for example for critical systems), performance, parallelism. Scala, Rust, C# (Go, C++ also, but I dislike these two) are better options.


Do they avoid all dynamic typed languages or only Python in particular?


All of them, but Python is the only one (apart from Javascript) that's approved for internal use.


I don't understand how aiohttp isn't even mentioned. It's such a joy to write HTTP servers with it.


The whole async ecosystem in Python seems like a bordering-on-insane duplication of work, given that a huge amount of the benefits can be gained simply by running your application under gevent (which is what many in the WSGI server crowd have been doing for yonks). The fact that every piece of code has to be rewritten (and usually in a very stupid way, like putting 'async' and 'await' in the right spots and otherwise leaving things alone) is just madness.

I'll grant you that aiohttp has a much nicer interface for websockets than I've seen in gevent-based libraries, but that seems like a very small win compared to the huge downside of chucking out most of the web server ecosystem and starting again.


Slightly off-topic: How do I delete all sorts of Python installations from various kinds of tools (pyenv, asdf, conda etc.) and just have the system one (on Arch Linux)?


In general: Find executables named `python` that aren't Arch's default and delete their related hierarchies?


Why is it flagged ? The article is imperfect, but midly useful.

It does forget to mention very important topics:

- type hints are finally useful, thanks to better mypy default and support, and allowing built-in, protocols and shortcuts into the syntax

- 3.10 ships with pattern matching and, I must insist, absolutely better error messages (being waiting for that for a while)

- black is the status quo formatting tool in the community

- pydantic base libs are getting a lot of traction (the article does mention typer, but not fast api)

- dephell allow you to convert between all those mess of various build systems so you can easily start with pip and move to poetry

- a new dev is now PAID by the PSF to work on python

- __pypackages__ is being actively experimented with, with initiatives like the pdm, the py launcher or pyflow (which also aims to take pyenv job, but saving you the compilation)

- plenty of speed work being done by MS, but also 2 other projects

- pyproject.toml is has now enough PEP to be better than setup.cfg , including one for a lock file

- vscode is now the most popular python ide, their language server pylance rocks and does feature auto imports now

- zipapps with shiv and compiled apps with nuitka changed the game of python deployment

- brett canon decided to use doit as a build tool publicly for new projects so it's getting traction. Ok, I kinda oversold it to him, but it's a good tool, it's worth checking out.

- asyncio is not a curiosity anymore, and the ecosystem is pretty mature, with uvloop, aiohttp, httpx, trio, etc. And the work for a integrated nurseries into the stdlib is on the way

- concurrency in Python has seen a boost because of the stdlib ShareMemory module, and sub interpretter are now being tested by popular projects

- python 2.7 has been dead for 1 year and it's business as uasual

- python 3.6 is the "old python" now. Funny, considering we used to thing f-string were the new toy

- rust is becomming python best friend, with more and more extensions being written in rust, and even one python implementation

- pyiodine makes it trivial to test real python code in a webpage. For web dev it's not usable, but for teaching it's been awesome:. Type to use sqlite in there, it's works magically, despite never touching the server : https://notebook.basthon.fr/

- htmx (the js lib) is getting used by pythonista that don't like js much

- wagtail, the cms, has become a thing of beauty

I probably forget a lot of things.


I agree it's unfortunate that this submission was flagged. The original article wasn't perfect but it has prompted several informative comments including the parent of this one, which most people presumably won't see now.


Off topic: is it just me or is the font of that webpage barely readable on screen?


Not just you. I immediately clicked Reader mode, although I couldn't really point to a definite trigger.


> Installing Python is still a non trivial task

How is running a command a non trivial task?


No love for Tkinter?


Although subjectively the look on Windows 10 seems a bit better than on previous versions, it still feels a bit ancient. So you may ask what's the point: if you create a GUI in 2021 you will probably want it to look modern and attractive. Even a modern TUI interface may look better.


Tk and Ttk are essentially different toolkits with a similar API. There are some decent looking themes (ark, breeze, yaru, there's even a bootstrap port) and also some native themes for Ttk. I believe the native Windows theme is Win32. You likely don't want an UI backed by Win32 widgets, for various reasons (poor performance, looks kind of bad, flicker/redraw issues, abandoned by MS).

I feel like desktop UIs on Windows have been in the state of "It hurts when I do this" - "Stop doing it then" for a number of years. "Just put everything in a web view" might actually be the best way to have a GUI on Windows nowadays, if you really need one, and otherwise you simply avoid having to run an application on Windows entirely whenever you can (=pure web app).


Do you happen to know a more modern GUI framework for Python?


Not an expert at all and can’t vouch for quality but there’s at least wxpython, pyqt, and wrappers of gtk, win32 and cocoa out there. There’s also a .net interop lib which might talk to windows libraries.

Many others exist, too. Most are wrappers of some C++ lib, like Qt etc. some wrap these wrappers again.


My take on these: Win32 gui is not modern, cocoa and gtk is not windows, pyqt is not free for commercial products,. Net interop in cpython is annoying, and until last year wxpython didn't work under python3. Wxpython might be worth looking at again though. (but then why not Tkinter)

Edit:anybody downvoting pls suggest a modern gui tool for python on desktop (which you hv experience with) . I need one and I have been looking. Using Tkinter now.


PySide. It's a Qt binding, under LGPL license. I used it for a fairly big project.


Python causes me a great deal of suffering. This XKCD summarizes one reason why. https://xkcd.com/1987/

Python deployment is an absolute nightmare. And don’t you dare say “just use conda”.

Python the language isn’t particularly great. The built-in libraries are a mixed bag. (Filesys is awful). But everyone is forced to use Python because numpy is super powerful and all the ML frameworks are in Python.

The fact that GIL is still an issue in 2021 is a god damn travesty. As is the overall awful performance of Python.

The language definitely got something right. But I can’t decide how much of its success is good ideas vs pure inertia.


Python definitely started with very good ideas and whatever success it has achieved is by merit and not marketing power or reputation of a company behind. Clean syntax, a decent object model, good documentation. Good taste in general.

But it's older than Java, think about that. Has it aged worse than other languages? Are Python libraries worse than Java's? Package management? Has Python more cruft? Is it harder to install?

At this point it's part inertia and network effects, although you should check the alternatives in ML: R, SAS, Matlab... I think Julia is better, but it has made some decisions not everyone likes. Static typing for ML, you may think, that would be awesome. Well, I think the language that got closest to it was Scala but it never escaped Spark.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: