PEP 3131: Supporting Non-ASCII Identifiers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan Behnel

    #91
    Re: PEP 3131: Supporting Non-ASCII Identifiers

    Marc 'BlackJack' Rintsch schrieb:
    In <mn.74c37d75c02 f9f3d.34209@mcl aveauPas.De.Spa m.com>, Michel Claveau
    wrote:
    >
    >And Il1 O0 ?
    >
    Hm, we should ban digits from identifier names. :-)
    Ah, good idea - and capital letters also. After all, they are rare enough in
    English to just plain ignore their existance.

    Stefan :)

    Comment

    • Grant Edwards

      #92
      Re: PEP 3131: Supporting Non-ASCII Identifiers

      On 2007-05-14, Stefan Behnel <stefan.behne l-n05pAM@web.dewr ote:
      Marc 'BlackJack' Rintsch schrieb:
      >In <mn.74c37d75c02 f9f3d.34209@mcl aveauPas.De.Spa m.com>, Michel Claveau
      >wrote:
      >>
      >>And Il1 O0 ?
      >>
      >Hm, we should ban digits from identifier names. :-)
      >
      Ah, good idea - and capital letters also. After all, they are
      rare enough in English to just plain ignore their existance.
      And I don't really see any need for using more than two
      characters. With just two letters (ignoring case, of course),
      you can create 676 identifiers in any namespace. That's
      certainly got to be enough. If not, adding a special caracter
      suffix (e.g. $,%,#) to denote the data type should sufficient
      expand the namespace.

      So, let's just silently ignore anything past the first two.
      That way we'd be compatible with Commodor PET Basic.

      [You don't want to know how long it took me to find all of the
      name-collision bugs after porting a basic program from a CP/M
      system which had a fairly sophisticated Basic compiler (no line
      numbers, all the normal structured programming flow control
      constructs) to a Commodore PET which had a really crappy BASIC
      interpreter.]

      --
      Grant Edwards grante Yow! Am I having fun yet?
      at
      visi.com

      Comment

      • =?UTF-8?Q?M=C3=A9ta-MCI?=

        #93
        Re: PEP 3131: Supporting Non-ASCII Identifiers

        Hi!

        - should non-ASCII identifiers be supported? why?
        - would you use them if it was possible to do so? in what cases?

        Yes.

        JScript can use letters with accents in identifiers
        XML (1.1) can use letters with accents in tags
        C# can use letters with accents in variables
        SQL: MySQL/MS-Sql/Oralcle/etc. can use accents in fields or request
        etc.
        etc.

        Python MUST make up for its lost time.


        MCI




        Comment

        • Jakub Stolarski

          #94
          Re: PEP 3131: Supporting Non-ASCII Identifiers

          On May 14, 9:49 pm, Méta-MCI <enleverlesX.X. ..@XmclaveauX.c omwrote:
          Hi!
          >
          - should non-ASCII identifiers be supported? why?
          - would you use them if it was possible to do so? in what cases?
          >
          Yes.
          >
          JScript can use letters with accents in identifiers
          XML (1.1) can use letters with accents in tags
          C# can use letters with accents in variables
          SQL: MySQL/MS-Sql/Oralcle/etc. can use accents in fields or request
          etc.
          etc.
          >
          Python MUST make up for its lost time.
          >
          MCI
          And generally nobody use it.
          It sounds like "are for art's sake".

          But OK. Maybe it'll be some impulse to learn some new languages.

          +1 for this PEP

          Comment

          • =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=

            #95
            Re: PEP 3131: Supporting Non-ASCII Identifiers

            In <slrnf4gafq.v74 .nick@irishsea. home.craig-wood.com>, Nick Craig-Wood
            wrote:
            >
            >My initial reaction is that it would be cool to use all those great
            >symbols. A variable called OHM etc!
            >
            This is a nice candidate for homoglyph confusion. There's the Greek
            letter omega (U+03A9) Ω and the SI unit symbol (U+2126) Ω, and I think
            some omegas in the mathematical symbols area too.
            Under the PEP, identifiers are converted to normal form NFC, and
            we have

            pyunicodedata.n ormalize("NFC", u"\u2126")
            u'\u03a9'

            So, OHM SIGN compares equal to GREEK CAPITAL LETTER OMEGA. It can't
            be confused with it - it is equal to it by the proposed language
            semantics.

            Regards,
            Martin

            Comment

            • =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=

              #96
              Re: PEP 3131: Supporting Non-ASCII Identifiers

              Not providing an explicit listing of allowed characters is inexcusable
              sloppiness.
              That is a deliberate part of the specification. It is intentional that
              it does *not* specify a precise list, but instead defers that list
              to the version of the Unicode standard used (in the unicodedata
              module).
              The XML standard is an example of how listings of large parts of the
              Unicode character set can be provided clearly, exactly and (almost)
              concisely.
              And, indeed, this is now recognized as one of the bigger mistakes
              of the XML recommendation: they provide an explicit list, and fail
              to consider characters that are unassigned. In XML 1.1, they try
              to address this issue, by now allowing unassigned characters in
              XML names even though it's not certain yet what those characters
              mean (until they are assigned).
              >``ID_Continue` ` is defined as all characters in ``ID_Start``, plus
              >nonspacing marks (Mn), spacing combining marks (Mc), decimal number
              >(Nd), and connector punctuations (Pc).
              >
              Am I the first to notice how unsuitable these characters are?
              Probably. Nobody in the Unicode consortium noticed, but what
              do they know about suitability of Unicode characters...

              Regards,
              Martin

              Comment

              • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

                #97
                Re: PEP 3131: Supporting Non-ASCII Identifiers

                Neil Hodgson schrieb:
                Paul Rubin wrote:
                >>Plenty of programming languages already support unicode identifiers,
                >>
                >Could you name a few? Thanks.
                >
                C#, Java, Ecmascript, Visual Basic.
                Specification-wise, C99 and C++98 also support Unicode identifiers,
                although many compilers still don't.

                For dynamic languages, Groovy also supports it.

                Regards,
                Martin

                Comment

                • Neil Hodgson

                  #98
                  Re: PEP 3131: Supporting Non-ASCII Identifiers

                  Martin v. Löwis:
                  Specification-wise, C99 and C++98 also support Unicode identifiers,
                  although many compilers still don't.
                  Ada 2005 allows Unicode identifiers and even includes the constant
                  'Ï€' in Ada.Numerics.

                  Neil

                  Comment

                  • Paul Rubin

                    #99
                    Re: PEP 3131: Supporting Non-ASCII Identifiers

                    Stefan Behnel <stefan.behne l-n05pAM@web.dewr ites:
                    But then, where's the problem? Just stick to accepting only patches that are
                    plain ASCII *for your particular project*.
                    There is no feature that has ever been proposed for Python, that cannot
                    be supported with this argument. If you don't like having a "go to"
                    statement added to Python, where's the problem? Just don't use it in
                    your particular project.

                    Comment

                    • ZeD

                      Re: PEP 3131: Supporting Non-ASCII Identifiers

                      Neil Hodgson wrote:
                      Ada 2005 allows Unicode identifiers and even includes the constant
                      '?' in Ada.Numerics.
                      this. is. cool.

                      (oh, and +1 for the pep)

                      --
                      Under construction

                      Comment

                      • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

                        Re: PEP 3131: Supporting Non-ASCII Identifiers

                        Paul Rubin schrieb:
                        >Plenty of programming languages already support unicode identifiers,
                        >
                        Could you name a few? Thanks.
                        The GNU assembler also supports non-ASCII symbol names on object file
                        formats that support it; this includes at least ELF (not sure about
                        PE32). Higher-level programming languages can use that to encode symbols
                        in UTF-8.

                        Regards,
                        Martin

                        Comment

                        • Stefan Behnel

                          Re: PEP 3131: Supporting Non-ASCII Identifiers

                          Paul Rubin wrote:
                          Stefan Behnel <stefan.behne l-n05pAM@web.dewr ites:
                          >But then, where's the problem? Just stick to accepting only patches that are
                          >plain ASCII *for your particular project*.
                          >
                          There is no feature that has ever been proposed for Python, that cannot
                          be supported with this argument. If you don't like having a "go to"
                          statement added to Python, where's the problem? Just don't use it in
                          your particular project.
                          "go to" is not meant for clarity, nor does it encourage code readability.

                          But that's what this PEP is about.

                          Stefan

                          Comment

                          • Stefan Behnel

                            Re: PEP 3131: Supporting Non-ASCII Identifiers

                            Paul Rubin wrote:
                            Stefan Behnel <stefan.behne l-n05pAM@web.dewr ites:
                            >But then, where's the problem? Just stick to accepting only patches that are
                            >plain ASCII *for your particular project*.
                            >
                            There is no feature that has ever been proposed for Python, that cannot
                            be supported with this argument. If you don't like having a "go to"
                            statement added to Python, where's the problem? Just don't use it in
                            your particular project.
                            "go to" is not meant for clarity, nor does it encourage code readability.

                            But that's what this PEP is about.

                            Stefan

                            Comment

                            • Eric Brunel

                              Re: PEP 3131: Supporting Non-ASCII Identifiers

                              On Mon, 14 May 2007 18:30:42 +0200, <rurpy@yahoo.co mwrote:
                              [snip]
                              Can a discussion about support for non-english identifiers (1)
                              conducted in a group where 99.9% of the posters are fluent
                              speakers of english (2), have any chance of being objective
                              or fair?
                              Agreed.
                              Although probably not-sufficient to overcome this built-in
                              bias, it would be interesting if some bi-lingual readers would
                              raise this issue in some non-english Python discussion
                              groups to see if the opposition to this idea is as strong
                              there as it is here.
                              Done on the french Python newsgroup.
                              --
                              python -c "print ''.join([chr(154 - ord(c)) for c in
                              'U(17zX(%,5.zmz 5(17l8(%,5.Z*(9 3-965$l7+-'])"

                              Comment

                              • Eric Brunel

                                Re: PEP 3131: Supporting Non-ASCII Identifiers

                                On Tue, 15 May 2007 07:15:21 +0200, ZeD <vito.detullio@ gmail.comwrote:
                                Neil Hodgson wrote:
                                >
                                > Ada 2005 allows Unicode identifiers and even includes the constant
                                >'?' in Ada.Numerics.
                                ^^^
                                this. is. cool.
                                Yeah, right... The problems begin...

                                Joke aside, this just means that I won't ever be able to program math in
                                ADA, because I have absolutely no idea on how to do a 'pi' character on my
                                keyboard.

                                Still -1 for the PEP...
                                --
                                python -c "print ''.join([chr(154 - ord(c)) for c in
                                'U(17zX(%,5.zmz 5(17l8(%,5.Z*(9 3-965$l7+-'])"

                                Comment

                                Working...