Let me start off by saying what is nice about Python:
- The philosophy of "one correct way to do things."
- Easy to learn (at the start).
- Pretty complete standard libraries.
- A huge ecosystem of good third-party libraries.
- Forced indentation. It's a mixed bag, but I've worked with too many junior developers who would never have indented otherwise.
- The
import
system makes it easy to trace the filepath for any dependency. """Docstrings"""
Now what's bad. TLDR: it's great for beginners, but then its syntax turns everything into a mess.
- The syntax for classical inheritance. Half of each Django app is
super().__init__(*args, **kwargs)
. At least you don't have to pass arguments tosuper
anymore. - Too many magic
__double-underscore__
methods and properties that you have to just memorize. - Too many top-level built-in functions that (a) you have to just memorize, and (b) get really ugly. You end up with stuff like
list(map(...))
. I haven't used so many nested parentheses since my early days in PHP. Guido's explanation makes sense in theory, but is really annoying in practice. - Too many other weirdo bits of magic syntax, like
[list comprehensions]
. - Django specifically is so full of magic words, and its documentation is so convoluted, that I've basically given up on documentation altogether and just look at the Django source code now.
- Needing to put dict property names `{'in': 'quotes'}.
- You have to cast your data back to a list/tuple after using
enumerate()
andmap()
. - Different syntaxes for lists and tuples.
foo['bar']
returns a KeyError, so you have to dofoo.get('bar')
... or in some casesgetattr(foo, 'bar', None)
, but not in others becausegetattr
and.get
are different things.- You can't just tack on flags to
/regular_expressions/ig
. - All the goofy string literals:
f' '
,u' '
,r' '
, etc. Pipfile
does not work that well.
I didn't really like Ruby until I started writing Python.
(Disclaimer: a big part of my frustration comes from having a JavaScript background. I know JavaScript is a "bad" language, so I was really excited to learn a "good" one... only to be disappointed in Python for many of the same general reasons JS is "bad.")