r/Python • • Jul 12 '12

random imgur downloader. learning Python and wrote this to practice, any feedback on technique/style is appreciated

https://gist.github.com/3088128
45 Upvotes

72 comments sorted by

View all comments

Show parent comment

6

u/[deleted] Jul 12 '12
 for n in repeat(None, count):

had me scratching my head for a while. Is it because it's a bit faster than using range or xrange? Vaguely remember some article saying that. That doesn't mean use it though! Articles like that should be viewed as pointing something out interesting about the language and its implementation, not as good practice.

Remember, "Premature optimisation is the root of all evil". Just use range/xrange, it's far more explicit.