Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bartl
on Nov 6, 2011
|
parent
|
context
|
favorite
| on:
Python: copying a list the right way
Well I don't think that in
b = list(a)
it's clear in any way that the purpose of "list" is to make a copy.
dextorious
on Nov 6, 2011
[–]
No, but it's clear that it returns a list out of "a".
philh
on Nov 6, 2011
|
parent
[–]
My guess upon seeing list(a) for the first time would have been that it returns [a], which is worse than not knowing what it does.
Possibly this is because I've known lisp longer than python.
lubutu
on Nov 6, 2011
|
root
|
parent
[–]
I agree. I write Python all the time, and I would have expected something like list(*a).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: