[Python-ideas] string codes & substring equality

spir denis.spir at gmail.com
Sun Dec 1 09:21:59 CET 2013


On 12/01/2013 12:48 AM, Guido van Rossum wrote:
> That FAQ entry does not do the real motivation justice. While OO "purists"
> may argue about it, to me it's obvious that in quite a few cases the
> function spelling is more readable than the method spelling. I found it
> more readable 23 years ago, and I still find it more readable today. So
> it's not historical reasons to me, even if not everybody agrees (obviously
> :-).

I was told ord() is a func because it works only on single-code (historically 
single-byte) strings (yes, ord throws an error otherwise, I just checked!).

 From a personal, nearly esthetic, pov, I'd rather make ord a method [s.ord(i)], 
and join not [join(strings, sep)]. But I do _not_ want to argue on this ;-).

Denis


More information about the Python-ideas mailing list