Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
andres
on May 29, 2009
|
parent
|
context
|
favorite
| on:
Curing Python's Neglect
the symmetric add/delete operations are actually:
mystuff[4] = 'apple'
del mystuff[4]
i'm not saying it's very elegant, but it makes sense.
calambrac
on May 29, 2009
[–]
mystuff[4] = 'apple' doesn't add an 'apple', it overwrites an existing element in a list of at least 5 elements, and del mystuff[4] actually does change the length of the list. They aren't symmetric at all.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
mystuff[4] = 'apple'
del mystuff[4]
i'm not saying it's very elegant, but it makes sense.