News for hackers. Stuff that matters.
Re:Common Python Mistakes by dmritard96 on Thursday May 08, 2014 @01:50PM (#7716586)
There are more than a few interesting points in here but this is funny to me coming from someone who is seemingly well versed in python: Mistake #5

numbers = [n for n in range(10)]

this should be: range(10)

Re:Common Python Mistakes by dragonwriter on Thursday May 08, 2014 @02:02PM (#7716668)
Unless its Python 3.x.

Though, really, even there, while the list comprehension works, its kind of an awkward construction to use that instead of:

  numbers = list(range(10))
Re:Common Python Mistakes by abaschin on Thursday May 08, 2014 @01:55PM (#7716620)
not in Python 3, where range() replaces xrange()
Re:Common Python Mistakes by dmritard96 on Thursday May 08, 2014 @01:57PM (#7716639)
interesting, haven't written in python 3 yet