Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
aldanor
on Oct 11, 2015
|
parent
|
context
|
favorite
| on:
Python wats
sorted is always a list, whereas reversed is an iterator (at least in Python 3)
masklinn
on Oct 11, 2015
[–]
Same in Python 2. A collection can even override "reversed" to provide their own reversed collection/iterator[0], not so for `sorted`.
[0]
https://docs.python.org/3/reference/datamodel.html?highlight...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: