[Python-Dev] Why both r'' and R'', u'' and U''?

Tim Peters tim.one@home.com
2001年1月14日 16:45:48 -0500


[?!ng]
> ...
> I'd bet that no one really relies on or expects the uppercase
> forms except L.

And 0X. I don't think it's in the std library, but I've certainly seen
Python code do stuff like
 magic = 0XFEEDFACE
Plus it's always good for a language to be able parse the stuff it prints,
and "0X..." is generated by Python's %#X format code.
Don't believe I've ever seen the "u" or "r" string modifiers in uppercase,
though, but really don't see the harm in allowing that.

AltStyle によって変換されたページ (->オリジナル) /