Live data from Hacker News

The State of Python in 2021

deprogrammaticaipsum.com

41–50 of 53 posts

Re: The State of Python in 2021

#41
> 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.

Re: The State of Python in 2021

#42

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.

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.

Re: The State of Python in 2021

#43
post #20

Earlier quoted context omitted.

> 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 sl…

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?

Re: The State of Python in 2021

#44

> 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 mise…

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.

Re: The State of Python in 2021

#45

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. 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.

Re: The State of Python in 2021

#46
post #15

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.

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

Re: The State of Python in 2021

#47
post #20

Earlier quoted context omitted.

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.

Re: The State of Python in 2021

#48
post #23

Earlier quoted context omitted.

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.

Re: The State of Python in 2021

#49
post #15

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

Re: The State of Python in 2021

#50

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 i…

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.
Post reply on HN