This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients dstufft, madison.may, rhettinger, terry.reedy
Date 2013-08-30.20:52:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377895945.31.0.366216635706.issue18826@psf.upfronthosting.co.za>
In-reply-to
Content
The two cases are not parallel.
  a = sorted(b)
abbreviates
  a = list(b)
  a.sorted()
which occurred often enough to be a nuisance. With this proposal,
  a = reversed(b)
would abbreviate
  a = reversed(list(b))
which is probably less common and certainly less obnoxious than the two lines condensed by sorted.

A second problem: reversed already has a fallback default if (a presumably more efficient or effective) b.__reversed__ does not exit:

n = len(b)
a = [None]*n
for i,j in enumerate(range(n-1, -1, -1)): # reversed(range(n))
  a[i] = b[j]

(I believe this is more efficient, at least in C, than
  a = []
  for i in range(len(b)-1, -1, -1):
    a.append(b[i])
but it is hard to know.)

At what point, and under what conditions, would you introduce the second fallback?
History
Date User Action Args
2013-08-30 20:52:25terry.reedysetrecipients: + terry.reedy, rhettinger, dstufft, madison.may
2013-08-30 20:52:25terry.reedysetmessageid: <1377895945.31.0.366216635706.issue18826@psf.upfronthosting.co.za>
2013-08-30 20:52:25terry.reedylinkissue18826 messages
2013-08-30 20:52:24terry.reedycreate