[Python-ideas] string codes & substring equality

spir denis.spir at gmail.com
Sun Dec 1 09:15:41 CET 2013


On 12/01/2013 12:42 AM, Andrew Barnert wrote:
> On Nov 28, 2013, at 22:49, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
>> spir wrote:
>>> (But then, possibly, some would wonder why this new ord(s,i) is not a string method ;-)
>>
>> For the same reason that the existing ord() function isn't
>> a string method, whatever that is!
>
> http://docs.python.org/2/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list
>
> The short version is: historical reasons, and no reason to change it compelling enough to be worth the costs in backward compat, bikeshedding, etc.

I'm very ok with extending the builtin func ord to get an index param: ord(i). 
Solves the issue without trouble, and backward compatibile. What do you think?

Denis


More information about the Python-ideas mailing list