On 2020-06-25 11:56:47 -0600, Michael Torrie wrote:
> On 6/24/20 7:38 PM, Grant Edwards wrote:
> > On 2020-06-24, Peter J. Holzer <hjp-pyt...@hjp.at> wrote:
> >> There is U+FF3F Fullwidth Low Line.
> >>
> >>> If there were, Python would not know what to do with it
> >>
> >> You can use it in variable names, but not at the beginning, and it isn't
> >> equivalent to two underscores, of course:
> > 
> > Ouch.  Anybody caught using that should be fed to a large snake.
> 
> Even allowing unicode letters in variable names period is questionable,
> but that loud debate was over years ago.  Fortunately I have never seen
> any python code in the wild with non-latin characters for variable
> names.

When I use German words as identifiers (I try to avoid this, but
sometimes translating to English would just confuse everybody), I do use
umlauts. I have also used Greek letters for physical quantities (e.g., ω
for angular velocity).

> Would make editing code very painful for developers from different
> locales and keyboards.

Yeah, editor support is a problem[1]. For my code with German identifiers
it is very unlikely that anybody who doesn't use German daily (and hence
already has the need to type umlauts) will ever have to edit it. The
Greek characters are in private code only.

        hp


[1] I use vim. Digraphs are a bit awkward but good enough for medium
    rare[2] characters. I don't know how to type characters not on the
    keyboard[3] in VS code or PyCharm or Emacs or whatever others are
    using. "I can't edit your code because I can't type that variable
    name" is certainly not something I want to hear from my colleagues.

[2] Pun not intended.

[3] Includes compose-sequences, if the keyboard has a compose key.

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | h...@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment: signature.asc
Description: PGP signature

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to