On 2/15/06, Neil Schemenauer <nas at arctrix.com> wrote: > I'm in the process of summarizing the dicussion on the bytes object > and an idea just occured to me. Imagine that I want to write code > that deals with strings and I want to be maximally compatible with > P3k. It would be nice if I could add: > > from __future__ import unicode_strings > > and have string literals without a 'u' prefix become unicode > instances. I'm not sure how tricky the implementation would be but > it seems like a useful feature. Didn't we have a command-line option to do this? I believe it was removed because nobody could see the point. (Or am I hallucinating? After several days of non-stop discussing bytes that must be considered a possibility.) Of course a per-module switch is much more useful. > An even crazier idea is to have that import change 'str' to be > an alias for 'unicode'. Now *that's* crazy talk. :-) It's probably easier to do that by placing a line str = unicode at the top of the file. Of course (like a good per-module switch should!) this won't affect code in other modules that you invoke so it's not clear that it always does the right thing. But it's a start. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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