Five Things I Hate About Python

brian d foy started this meme at the beginning of this month and many Pythoneers have joined in.  So it’s time I joined the party.

  1. The Whitespace.  I love it and I hate it. I love it because it makes the code look clean and readable.  But if you are editing someone else’s scripts and they have different tab settings than you or they used a space and a tab, etc. it’s painful.  Emacs with python-mode makes this a little better, but it’s still horrible.
  2. Lack of a automatic repository.  This has been said many times before but CPAN has it right.  I wish I could type a command and Python would find, download, and install a new module for me.  Eggs almost have it, but I still have to download something.
  3. time vs datetime modules.  I wish I could use the datetime module for everything related to timestamps, but I can’t.  And I can’t get a lot done in the time module without a lot of work.  This madness must stop.  This wouldn’t bother me so much if I didn’t have to do so much with timestamps.
  4. File name handling.  If you stick with the standard library you need to be familiar with  os.path, glob, os, shutil and sys modules to really work with file names. And don’t get me started on os.path.walk. Jason Orendorff’s glorious path module solves these problems.  So why isn’t it in the standard library yet?
  5. if __name__=='__main__'.  Who made that up?  Does anyone still think it’s a good idea?  I have a template setup that automatically puts that in a new Python file (along with a few imports) but it just looks weird.

Leave a Reply

You must be logged in to post a comment.