[Python-ideas] string codes & substring equality

spir denis.spir at gmail.com
Fri Nov 29 07:22:00 CET 2013


On 11/29/2013 01:45 AM, Steven D'Aprano wrote:
> Should strings have an ord() method?
>
> Disadvantages:
>
> - another piece of code to be written, debugged, maintained, documented;
>
> - another thing for users to learn;
>
> - cognitive load of having to decide whether to use the ord() method or
>    the ord() function.
>
>
> Advantage:
>
> - you save the cost of extracting a one-character string before passing
>    it to the ord() function.

Why is there ord(), the builtin func?

Denis


More information about the Python-ideas mailing list