Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Strings: '\012' -> '\n'

Eric S. Raymondesr@thyrsus.com
Mon, 15 Jan 2001 23:43:24 -0500


Tim Peters <tim.one@home.com>:> I would also be +1 on using hex escapes instead of octal (I grew up on 36-> and 60-bit machines, but that was the last time octal looked *natural*!).> Octal and hex escapes both consume 4 characters, so I can't imagine what> octal has going for it in the 21st century <wink>.Tim, on the level of aesthetic preference I'm totally with you.  I've alwaysfound octal really ugly myself.  Hex fits my brain better; somehow I find iteasier to visualize the bit patterns from.Sadly, there are so many other related ways in which Pythonintelligently follows C/Unix conventions that I think changing to a defaultof hex escapes rather than octal would violate the Rule of LeastSurprise.One of the things I like about Python is precisely its conservatism inareas like string escapes, that Guido refrained from inventing new OSAPIs or new conventions for things like string escapes in places whereUnix and C did them in a well-established and reasonable way.  He didn'tmake the mistake, all too typical in academic languages, of confusingnovelty with value...This conservatism is valuable because it frees the C-experiencedprogrammer's mind from having to think about where the language istrivially different, so he can concentrate on where it's importantlydifferent.  It's worth maintaining.On the other hand, the change would mesh well with the Unicode support.Hmm.  Tough call.  I could go either way, I guess.-- <a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>The politician attempts to remedy the evil by increasing the very thingthat caused the evil in the first place: legal plunder.-- Frederick Bastiat


[8]ページ先頭

©2009-2025 Movatter.jp