Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
omegote
on July 9, 2014
|
parent
|
context
|
favorite
| on:
Anti-Patterns in Python Programming
Point 3 of the iteration part is not good advice. With [1:] you're making a copy of the list just to iterate over it...
omaranto
on July 9, 2014
|
next
[–]
You're right. I still wouldn't recommend looping over indices, but rather using itertools.islice(xs, 1, None) instead of xs[1:].
zo1
on July 9, 2014
|
prev
[–]
You're right... But at least it's a shallow copy.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: