DEV Community

What’s the thing you hate the most in Python?

Nguyen Kim Son on September 27, 2019

Don’t take me wrong, I use Python in most of my projects and Python is my most loved language. But sometimes it still drives me crazy... Some of th...
Collapse
 
erikwhiting88 profile image
Erik

I feel you on the import system.

I'm also not a fan of all times you gotta write self it's just clutter

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

I would much rather have to type the same variable name multiple times in a method than deal with a magic keyword with complex binding rules like you need to do in JS.

Collapse
 
loki profile image
Loki Le DEV

The thing I don't like is that since it's interpreted you must run your code to check for bugs that could be found by a compiler. Making the need for unit tests even more important. IDE's help a lot also on this issue.

Collapse
 
sonnk profile image
Nguyen Kim Son • Edited

I think there are both pros and cons for interpreter languages. Main advantage is fast experimentation as there’s no need to compile the code before. The cons, like you said, is the check is quite minimal...

Collapse
 
cyber1998 profile image
Cyber Naskar

I would have loved it if Python supported static typing.

Collapse
 
sonnk profile image
Nguyen Kim Son

Would love to see that coming too!

Collapse
 
toastking profile image
Matt Del Signore

I dislike all the "spooky action at a distance" that happens in python. Stuff like all the special variables like name. It makes learning the language unintuitive at times.

Collapse
 
alansolitar profile image
Alan Solitar

The lack of a standard library deep getter function / optional chaining operator bugs me a fair bit.

Collapse
 
sonnk profile image
Nguyen Kim Son

Can you elaborate more on this please?

Collapse
 
alansolitar profile image
Alan Solitar

for example:

in python there isn't really an elegant built-in way to handle getting nested dictionary values that might not exist.

i.e. my_dict['key1']['key2']['key3']

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

I am surprised that Python lacks a "switch case" statement. Import cycles have never affected me... somehow.