Why prefer != over <> for Python 3.0?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Colin J. Williams

    #16
    Re: Why prefer != over &lt;&gt; for Python 3.0?

    kwitters@telene t.be wrote:
    I don't know if this is the right place to discuss the death of <in
    Python 3.0, or if there have been any meaningful discussions posted
    before (hard to search google with '<>' keyword), but why would anyone
    prefer the comparison operator != over <>???
    >
    I've written an article about it to try and save this nice "is not
    equal" operator, located at http://dewitters.koonsolo.com/python_neq.html
    >
    Please set it straight in 3.0, and if not, convince me with a good
    reason of doing so, so that I can live with it and don't have to spend
    the rest of my life in 2.x ;).
    Algol 60 had no such operator.
    Algol-W had (not)= [(not) was a negative
    symbol, not on our current keyboard]
    Simula 67 introduced <>
    Pascal uses <[Pascal is still
    available - http://www.freepascal.org/]
    C uses !=
    [http://cermics.enpc.fr/~ts/C/CONCEPT...ions.html#rel]

    I prefer <but I feel that it's better
    not to have two ways of representing
    not equal.

    The powers that be have chosen !=. I
    accept this on the grounds that current
    languages seem to have nade that choice.

    Colin W.

    Comment

    • MRAB

      #17
      Re: Why prefer != over &lt;&gt; for Python 3.0?

      On Mar 30, 6:35 am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
      wrote:
      En Sun, 30 Mar 2008 02:11:33 -0300, hdante <hda...@gmail.c omescribió:
      >
      BTW, my opinion is that it's already time that programmer editors
      have input methods advanced enough for generating this:
      >
      if x ≠ 0:
      ∀y ∈ s:
      if y ≥ 0: f1(y)
      else: f2(y)
      >
      Fine if you have the right keyboard... Try to write APL with a standard
      keyboard :)
      >
      There was a version of APL for the Sinclair QL which replaced the
      standard APL symbols with keywords.

      Comment

      • Dan Bishop

        #18
        Re: Why prefer != over &lt;&gt; for Python 3.0?

        On Mar 30, 5:40 am, Torsten Bronger <bron...@physik .rwth-aachen.de>
        wrote:
        Hallöchen!
        >
        Bjoern Schliessmann writes:
        Lie wrote:
        >
        Ah yes, that is also used (I completely forgot about that one, my
        math's aren't that sharp anymore) and I think it's used more
        frequently than ><.
        >
        Where did you read that (I mean, which country)? I've never seen
        this sign in any german or english book on
        mathematics/physics/engineering I saw.
        >
        Maybe he means "≷".
        >
        but my argument was that no math book use != or <(except in
        math for programmers).
        >
        That's true. Personally, I don't ever use "a!=b" in favor of "not
        a==b".
        >
        As a side note, I've always found == rather ugly. I'd prefer to
        have = for both purposes.
        The earliest versions of Python *did* use = for both purposes.
        The constructs that wouldn't work anymore
        are rare as far as I can see (and possibly there are even
        workarounds).
        The construct a = b == c could be rewritten as a = (b = c).

        Comment

        • Lie

          #19
          Re: Why prefer != over &lt;&gt; for Python 3.0?

          On Mar 30, 7:48 pm, Bjoern Schliessmann <usenet-
          mail-0306.20.chr0n.. .@spamgourmet.c omwrote:
          Torsten Bronger wrote:
          Maybe he means "?".
          >
          Haven't seen this either, nor do I think it's the same than "<>".
          From afar, it looks more like "><".
          Actually I meant an X-like symbol that is made not by crossing but by
          ><. I retracted saying it is the standard, now that I think about it
          the last time I saw >< was in elementary school (although it stuck on
          my head better than a crossed =, which I first met in high school).
          But this does more look like
          South Park style shut eyes than an operator. :)
          lol, I agree, it looks too much like closed eye smiley. Forums might
          automatically convert them to graphic smileys so it is obviously a bad
          choice if it is to be used.

          Comment

          • Lie

            #20
            Re: Why prefer != over &lt;&gt; for Python 3.0?

            On Mar 30, 5:25 pm, Bjoern Schliessmann <usenet-
            mail-0306.20.chr0n.. .@spamgourmet.c omwrote:
            Lie wrote:
            Ah yes, that is also used (I completely forgot about that one, my
            math's aren't that sharp anymore) and I think it's used more
            frequently than ><.
            >
            Where did you read that (I mean, which country)? I've never seen
            this sign in any german or english book on
            mathematics/physics/engineering I saw.
            It was in my elementary school at Indonesia (FYI, it is also used as
            antonym sign in languages (at least in my country)). And I think I'll
            retract that claim, >< wasn't the standard, a crossed = is the
            standard (btw, with a little imagination != looks like a crossed =).

            Comment

            • Gabriel Genellina

              #21
              Re: Why prefer != over &lt;&gt; for Python 3.0?

              En Sun, 30 Mar 2008 11:10:20 -0300, MRAB <google@mrabarn ett.plus.com>
              escribió:
              On Mar 30, 6:35 am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
              wrote:
              >En Sun, 30 Mar 2008 02:11:33 -0300, hdante <hda...@gmail.c omescribió:
              >>
              BTW, my opinion is that it's already time that programmer editors
              have input methods advanced enough for generating this:
              >>
              if x ≠ 0:
              ∀y ∈ s:
              if y ≥ 0: f1(y)
              else: f2(y)
              >>
              >Fine if you have the right keyboard... Try to write APL with a standard
              >keyboard :)
              >>
              There was a version of APL for the Sinclair QL which replaced the
              standard APL symbols with keywords.
              Wow, APL on 8 bits?
              Now there is (or perhaps there was) J, a reincarnation of APL by Iverson
              himself that uses ASCII characters only.

              --
              Gabriel Genellina

              Comment

              • hdante

                #22
                Re: Why prefer != over &lt;&gt; for Python 3.0?

                On Mar 30, 9:45 am, Bjoern Schliessmann <usenet-
                mail-0306.20.chr0n.. .@spamgourmet.c omwrote:
                hdante wrote:
                BTW, my opinion is that it's already time that programmer editors
                have input methods advanced enough for generating this:
                >
                Could you please list some that do, and are also convenient?
                AFAICT there's none. This should be easy to implement on emacs, or in
                SCIM.
                >
                Regards,
                >
                Björn
                >
                --
                BOFH excuse #288:
                >
                Hard drive sleeping. Let it wake up on it's own...

                Comment

                • Torsten Bronger

                  #23
                  Re: Why prefer != over &lt;&gt; for Python 3.0?

                  Hallöchen!

                  hdante writes:
                  On Mar 30, 9:45 am, Bjoern Schliessmann <usenet-
                  mail-0306.20.chr0n.. .@spamgourmet.c omwrote:
                  >
                  >hdante wrote:
                  >>
                  >>BTW, my opinion is that it's already time that programmer
                  >>editors have input methods advanced enough for generating this:
                  >>
                  >Could you please list some that do, and are also convenient?
                  >
                  AFAICT there's none. This should be easy to implement on emacs,
                  It *is* implemented in Emacs. You can even choose from many input
                  methods, optimised for differend areas/languages.

                  Tschö,
                  Torsten.

                  --
                  Torsten Bronger, aquisgrana, europa vetus
                  Jabber ID: bronger@jabber. org
                  (See http://ime.webhop.org for further contact info.)

                  Comment

                  • hdante

                    #24
                    Re: Why prefer != over &lt;&gt; for Python 3.0?

                    On Mar 30, 6:08 pm, Torsten Bronger <bron...@physik .rwth-aachen.de>
                    wrote:
                    Hallöchen!
                    >
                    hdante writes:
                    On Mar 30, 9:45 am, Bjoern Schliessmann <usenet-
                    mail-0306.20.chr0n.. .@spamgourmet.c omwrote:
                    >
                    hdante wrote:
                    >
                    >BTW, my opinion is that it's already time that programmer
                    >editors have input methods advanced enough for generating this:
                    >
                    Could you please list some that do, and are also convenient?
                    >
                    AFAICT there's none. This should be easy to implement on emacs,
                    >
                    It *is* implemented in Emacs. You can even choose from many input
                    methods, optimised for differend areas/languages.
                    I mean creating an input method specific for programming languages,
                    not using the TeX one.
                    >
                    Tschö,
                    Torsten.
                    >
                    --
                    Torsten Bronger, aquisgrana, europa vetus
                    Jabber ID: bron...@jabber. org
                    (Seehttp://ime.webhop.orgf or further contact info.)

                    Comment

                    • Bjoern Schliessmann

                      #25
                      Re: Why prefer != over &lt;&gt; for Python 3.0?

                      Torsten Bronger wrote:
                      Emacs is generally not regarded as being convenient, however, it
                      has very strong input methods. I type "\gtrless" and get "?",
                      or "\forall" and get "?".
                      I wonder where the point of this is. :) Why use fancy unicode chars
                      if they're not better to read (apart from not being readable with
                      every font) and require at least the same amount of keypresses?

                      Regards,


                      Björn

                      --
                      BOFH excuse #123:

                      user to computer ratio too high.

                      Comment

                      • Torsten Bronger

                        #26
                        Re: Why prefer != over &lt;&gt; for Python 3.0?

                        Hallöchen!

                        Bjoern Schliessmann writes:
                        Torsten Bronger wrote:
                        >
                        >Emacs is generally not regarded as being convenient, however, it
                        >has very strong input methods. I type "\gtrless" and get "?", or
                        >"\forall" and get "?".
                        Doesn't KNode support UTF-8?
                        I wonder where the point of this is. :) Why use fancy unicode
                        chars if they're not better to read (apart from not being readable
                        with every font) and require at least the same amount of
                        keypresses?
                        Who wants to minimize the number of keypresses? We're not Perl
                        after all. ;-)

                        As a general rule of thumb in typography, more glyph forms increase
                        readability. APL is not readable at all but this is due to its
                        syntax I suppose. I find hdante's excerpt very readable.

                        The only reason why we don't use those special characters is that
                        they aren't ASCII. While ∀ or ∈ are questionable because Python
                        prefers English words instead of scientific symbols, ≠ or ≤ would be
                        certainly more legible than != or <=. But they are not ASCII, so
                        there is no net benefit.

                        However, I'm quite sure that when Unicode has arrived almost
                        everywhere, some languages will start considering such characters in
                        their core syntax. Python 3.0 allows for Unicode letters in
                        identifiers, and there's still room for improvement.

                        Tschö,
                        Torsten.

                        --
                        Torsten Bronger, aquisgrana, europa vetus
                        Jabber ID: bronger@jabber. org
                        (See http://ime.webhop.org for further contact info.)

                        Comment

                        • Paul Rubin

                          #27
                          Re: Why prefer != over &lt;&gt; for Python 3.0?

                          Torsten Bronger <bronger@physik .rwth-aachen.dewrites :
                          However, I'm quite sure that when Unicode has arrived almost
                          everywhere, some languages will start considering such characters in
                          their core syntax. Python 3.0 allows for Unicode letters in
                          identifiers, and there's still room for improvement.
                          I agree. What's the codepoint for lower case lambda?

                          Comment

                          • Bjoern Schliessmann

                            #28
                            Re: Why prefer != over &lt;&gt; for Python 3.0?

                            Torsten Bronger wrote:
                            Doesn't KNode support UTF-8?
                            Well, it should, but automatic encoding detection doesn't always
                            seem to work (or does it even have one?). I'm looking for a
                            different (faster) newsreader anyway.
                            Who wants to minimize the number of keypresses? We're not Perl
                            after all. ;-)
                            Sure, but I also don't want to enter fancy unicode operators. I'm
                            using Python on some computers that even don't support unicode.
                            However, I'm quite sure that when Unicode has arrived almost
                            everywhere, some languages will start considering such characters
                            in their core syntax.
                            This should be the time when there are widespread quasi-standardised
                            input methods for those characters.

                            Regards,


                            Björn

                            --
                            BOFH excuse #154:

                            You can tune a file system, but you can't tune a fish (from most
                            tunefs man pages)

                            Comment

                            • Terry Reedy

                              #29
                              Re: Why prefer != over &lt;&gt; for Python 3.0?


                              "Bjoern Schliessmann" <usenet-mail-0306.20.chr0n0s s@spamgourmet.c omwrote
                              in message news:65c0bfF2ff ipiU1@mid.indiv idual.net...
                              | However, I'm quite sure that when Unicode has arrived almost
                              | everywhere, some languages will start considering such characters
                              | in their core syntax.
                              |
                              | This should be the time when there are widespread quasi-standardised
                              | input methods for those characters.

                              C has triglyphs for keyboards missing some ASCII chars. != and <= could
                              easily be treated as diglyphs for the corresponding chars. In a sense they
                              are already, it is just that the real things are not allowed ;=).




                              Comment

                              • Gabriel Genellina

                                #30
                                Re: Why prefer != over &lt;&gt; for Python 3.0?

                                En Mon, 31 Mar 2008 16:17:39 -0300, Terry Reedy <tjreedy@udel.e du>
                                escribió:
                                "Bjoern Schliessmann" <usenet-mail-0306.20.chr0n0s s@spamgourmet.c om>
                                wrote
                                in message news:65c0bfF2ff ipiU1@mid.indiv idual.net...
                                | However, I'm quite sure that when Unicode has arrived almost
                                | everywhere, some languages will start considering such characters
                                | in their core syntax.
                                |
                                | This should be the time when there are widespread quasi-standardised
                                | input methods for those characters.
                                >
                                C has triglyphs for keyboards missing some ASCII chars. != and <= could
                                easily be treated as diglyphs for the corresponding chars. In a sense
                                they
                                are already, it is just that the real things are not allowed ;=).
                                I think it should be easy to add support for ≠≤≥ and even λ, only the
                                tokenizer has to be changed.

                                --
                                Gabriel Genellina

                                Comment

                                Working...