Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't even touch on my personal pet peeve, people who don't use list and dict literals. I assume they're former Java programmers who got ahold of enough python knowledge to be dangerous. e.g:

  x = dict()
  x['a'] = 'string'
  x['b'] = list()
  x['b'].append('foo')
  x['b'].append('bar')


You can say

    x = dict(a = 'string', b = list(('foo', 'bar')))


Literals are much more readable in any language I've used (or at least can think of right now).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: