git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pycharm Won't Do Long Underscore


On 2020-06-24 13:48:18 -0400, Dennis Lee Bieber wrote:
> On Tue, 23 Jun 2020 20:49:36 +0000, Tony Kaloki <tkaloki at live.co.uk>
> declaimed the following:
> > Alexander,
> > Thank you so much! It worked! Thank you. One question: in your
> > reply, are you saying that Python would have treated the two
> > separate underscores the same way as a long  underscore i.e. it's a
> > stylistic choice rather than a functional necessity?
> 
> 	There is no "long underscore" in the character set.

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:

    Python 3.9.0b3 (default, Jun 13 2020, 10:49:29)
    [GCC 7.5.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> ? = 12
      File "<stdin>", line 1
        ? = 12
        ^
    SyntaxError: invalid character '?' (U+FF3F)
    >>> a? = 12
    >>> a?
    12
    >>> a__
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'a__' is not defined
    >>>

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20200624/0443c1e1/attachment.sig>