Live data from Hacker News

All the things I hate about Python

medium.com

21–30 of 87 posts

Re: All the things I hate about Python

#21
All points are at least semi-valid concerns.

However, what is the cost of addressing them? Slower development (core lang and ecosystem). Less use in niche fields. Less flexibility to adapt to new challenges.

Python is a rusty toolbox that's been put together over 27 years.

You know why it's still around? Because people can use it to do the things they want to do.

Fixing all the warts would give us the language we need now... in about 15 years. Which would by then be useless.

Re: All the things I hate about Python

#22
> However, Python does not have a real privacy model.

> This is unsettling if you’re coming from a Java or C/C++ world and are expecting access modifiers

It's unsettling to a lot of people, but so what? I still don't see a solid use case for where member access (not "privacy") is a good idea. Python is one of the only languages to get access modifiers right (convention), imo and I don't even like Python.

You could implement some "privacy" with a lambda closure (which gets increasingly complex), but that's one more technique that lambdas are ill-suited for.

Re: All the things I hate about Python

#23
My main beef with python is its packaging management.

It's a clusterfuck of half-baked, non-standard, spaghetti code approaches.

The Zen of Python says "There should be one-- and preferably only one --obvious way to do it." Python package management makes that in to a joke.

Re: All the things I hate about Python

#24
> There is no short answer as to what is fully going on here, but simply put, Python modules are packaged either as a Wheel or an Egg

This is a false dichotomy -- there are actually many different ways to package a Python module, including source distributions (sdists). These are just the two most well-known types of built distributions.

> The numpy module is a wheel, i.e. it is a source distribution that depends on a handful of system libraries — gfortran, blas, lapack, atlas — to compile properly.

This is not correct, a wheel is specifically not a source distribution, it is a built distribution. The dependency on platform-level libraries has nothing to do with what type of distribution it is.

NumPy publishes a lot of wheels for a given release (https://pypi.org/project/numpy/#files) each of which is platform-specific, since they are pre-built (pre-compiled) for a given platform.

In the event that a built distribution isn't available for your platform, that's when pip falls back on the source distribution, which requires the build step (hence the dependency on gcc or clang).

Re: All the things I hate about Python

#25

> Python is considered a weakly-typed or dynamically-typed programming language. This isn't right. Weak/strong typing is on a different axis than static/dynamic typing. Python is strongly typed. There's no implicit conversion among types (which is one marker of weak-typedness). For proof, consider: >>> 1 + '3' [...] TypeError: unsupported operand type(s) for +: 'int' and 'str' Strongly typed means that the types are…

Nobody seems to agree on a definition of strongly typed: https://stackoverflow.com/questions/430182/is-c-strongly-typ...

Re: All the things I hate about Python

#26
post #22

> However, Python does not have a real privacy model. > This is unsettling if you’re coming from a Java or C/C++ world and are expecting access modifiers It's unsettling to a lot of people, but so what? I still don't see a solid use case for where member access (not "privacy") is a good idea. Python is one of the only languages to get access modifiers right (convention), imo and I don't even like Python. You could im…

The author makes a lot of strong statements based on their opinions. I wrote a bit about their dynamic/weak typing gaffe in another top-level comment.

> lambda closure

Just FYI (not intended to be mean or anything), in formal PL theory this phrasing doesn't make sense. A closure is the pairing of an anonymous function (a "lambda") with an environment. Python's "lambda" is really just a lambda --- it is not a closure. This is revealed in the common pitfall where you try to create a list comprehension using a lambda to generate interior values.

Re: All the things I hate about Python

#27
post #22

> However, Python does not have a real privacy model. > This is unsettling if you’re coming from a Java or C/C++ world and are expecting access modifiers It's unsettling to a lot of people, but so what? I still don't see a solid use case for where member access (not "privacy") is a good idea. Python is one of the only languages to get access modifiers right (convention), imo and I don't even like Python. You could im…

The author makes a lot of strong statements based on their opinions. I wrote a bit about their dynamic/weak typing gaffe in another top-level comment. > lambda closure Just FYI (not intended to be mean or anything), in formal PL theory this phrasing doesn't make sense. A closure is the pairing of an anonymous function (a "lambda") with an environment. Python's "lambda" is really just a lambda --- it is not a closure.…

The idea is to create a lambda that's sole purpose is to act as a closure for member access restriction. I'm not sure how that could be misinterpreted, but here's your prize.

Re: All the things I hate about Python

#28
post #25

> Python is considered a weakly-typed or dynamically-typed programming language. This isn't right. Weak/strong typing is on a different axis than static/dynamic typing. Python is strongly typed. There's no implicit conversion among types (which is one marker of weak-typedness). For proof, consider: >>> 1 + '3' [...] TypeError: unsupported operand type(s) for +: 'int' and 'str' Strongly typed means that the types are…

Nobody seems to agree on a definition of strongly typed: https://stackoverflow.com/questions/430182/is-c-strongly-typ...

While true that there is no single official definition, it does not give the author license to portray the community in such a negative light.

As an aside, I work in PL research (as an assistant) and have never talked to a researcher who disagreed with the assessment I gave above. I'm not saying you're wrong (because you aren't), but rather that there is at least enough of a distinction that the author shouldn't have conflated them to the extent that they did.

Re: All the things I hate about Python

#29
post #11

This starts off with a misunderstanding of what "strongly typed" means. Python is strongly, but dynamically typed. Static typing means you know the type of something at compile time. Dynamic typing means you don't. The upside to dynamic typing is that the compiler doesn't have to prove much about your program; the downside is that it can't really prove much of interest either. Strong vs weak typing is about how much…

You're correct but this barely changes the authors points:

"It’s virtually impossible to statically analyze"

and

"In Python a good amount of errors are discovered at runtime"

Re: All the things I hate about Python

#30
post #27

Earlier quoted context omitted.

The author makes a lot of strong statements based on their opinions. I wrote a bit about their dynamic/weak typing gaffe in another top-level comment. > lambda closure Just FYI (not intended to be mean or anything), in formal PL theory this phrasing doesn't make sense. A closure is the pairing of an anonymous function (a "lambda") with an environment. Python's "lambda" is really just a lambda --- it is not a closure.…

The idea is to create a lambda that's sole purpose is to act as a closure for member access restriction. I'm not sure how that could be misinterpreted, but here's your prize.

I guess my point was that you should have just said "closure" instead of "lambda closure", since that phrasing doesn't make any sense in a formal context. Lambdas and closures are different things entirely. I really wasn't trying to be patronizing or anything; I was just trying to offer information in case you found it interesting, but I guess I missed the mark there. My apologies.
Post reply on HN