Language design

Steven D'Aprano steve at pearwood.info
Tue Sep 10 02:09:25 EDT 2013


Some time ago, Tom Christiansen wrote about the "Seven Deadly Sins of 
Perl":

http://www.perl.com/doc/FMTEYEWTK/versus/perl.html


What design mistakes, traps or gotchas do you think Python has? Gotchas 
are not necessarily a bad thing, there may be good reasons for it, but 
they're surprising.

To get started, here are a couple of mine:


- Python is so dynamic, that there is hardly anything at all that can be 
optimized at compile time.

- The behaviour of mutable default variables is a gotcha.

- Operators that call dunder methods like __add__ don't use the same 
method resolution rules as regular methods, they bypass the instance and 
go straight to the type, at least for new-style classes.



-- 
Steven



More information about the Python-list mailing list