Fredrik Lundh wrote: > > M.-A. Lemburg wrote: > > The recent discussion about repr() et al. brought up the idea > > of a locale based string encoding again. > > before proceeding down this (not very slippery but slightly > unfortunate, imho) slope, I think we should decide whether > > assert eval(repr(s)) == s > > should be true for strings. > > if this isn't important, nothing stops you from changing 'repr' > to use isprint, without having to make sure that you can still > parse the resulting string. > > but if it is important, you cannot really change 'repr' without > addressing the big issue. This is a different discussion which I don't really want to get into... I don't have any need for repr() being locale dependent, since I only use it for debugging purposes and never to rebuild objects (marshal and pickle are much better at that). BTW, repr(unicode) is not affected by the string encoding: it always returns unicode-escape. -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4