[Python-3000] Support for PEP 3131
showell30 at yahoo.com
Fri May 25 01:49:49 CEST 2007
--- "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > FWIW the Ruby interpreter (1.8.5) seems to require
> > this flag to allow you to turn on the Japanese
> > set.
> > -Kkcode specifies KANJI (Japanese) code-set
> > I have no idea whether or not this cripples the
> > feature in Ruby, and perhaps it's an
> > comparison.
> If you don't have source encoding declarations (like
> the one
> in PEP 263), you must have some means of setting the
> encoding; this is what -Kkcode does (similar to
> -encoding command line option).
> This approach has several flaws, e.g. you can only
> a single encoding, which breaks if you have modules
> different encodings.
> In any case, it's different from the suggested -UU
> Python already knows what the source encoding is,
> would not change that. Instead, that option would
> serve to constrain the source code (if it's not
Ok, I think it's pretty clear that this is an
apples/oranges comparison, and there are lots of
differences between Ruby's implementation and PEP 3131
that muddy the waters.
Still, the reason I brought it up is still valid, I
Ruby is a language that presumably has a lot of
Japanese users, and it appears to me (I'm not a Ruby
person, so I admit this is speculation) that Japanese
users have to explicitly choose to use Japanese
encoding to run source files encoded in Japanese.
Setting aside all the limitations of Ruby, wouldn't
the fact that non-latin-writing Japanese Ruby users
live with the command line restriciton in Ruby suggest
that they'd be just as willing to live with command
line burdens in Python, if they decided to switch to
To your point about Py3k being more flexible, couldn't
you imagine a scenario where a Japanese programmer
gets fed up with Ruby's all-or-nothing capability with
respect to Kanji, and switches over to Python, and
changes his little wrapper shell script to say "python
-U" instead of "ruby -Kkcode"? He could then start to
use non-Japanese Python modules while still writing
his own Python code in Japanese.
____________________________________________________________________________________Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
More information about the Python-3000