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 Rosuav, ezio.melotti, loewis, terry.reedy, vstinner
Date 2013-04-04.01:55:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365040520.52.0.441998081913.issue17629@psf.upfronthosting.co.za>
In-reply-to
Content
ord(max(s)) == max(map(ord,s)) == ord(max(s, key=ord))
Using a*30000000 and mental counting, the first is clearly fastest (about 2 seconds) with a 3.4 build, which has the optimized string comparison patches from last October. The reduction to 3 categories takes almost no time.

I'm -1 without some real use case. For most testing, the data are constructed, so we already know the CPython internal width.

There is no comparison in importance between and len/__len__. bool(x) calls x.__len__ if no x.__bool__. strings and other builtin collection classes have no __bool__.

> .. cost little or nothing
Every addition has a real cost: for developers, write code, write test, test test, write doc, maintain; for users, more to learn and understand -- and forget. I doubt the value of the compute time saved would ever come close to the value of the human time expended. There is also a cost to adding something CPython-specific.
History
Date User Action Args
2013-04-04 01:55:20terry.reedysetrecipients: + terry.reedy, loewis, vstinner, ezio.melotti, Rosuav
2013-04-04 01:55:20terry.reedysetmessageid: <1365040520.52.0.441998081913.issue17629@psf.upfronthosting.co.za>
2013-04-04 01:55:20terry.reedylinkissue17629 messages
2013-04-04 01:55:20terry.reedycreate