• backslash in triple quoted string

    From Bob van der Poel@bob@mellowood.ca to comp.lang.python on Wed May 7 20:20:27 2025
    From Newsgroup: comp.lang.python

    Did something change in python buggering up my use of a "\ " sequence in a triple quoted string?

    I have yet to go through my archive on the program, but I tried to run it
    today and it crashed quite spectacularly when it hit a """ .... """ line
    being used as a comment at the top of a function. I changed the "\" to a
    "/" and all is well now.
    --

    **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
    Bob van der Poel ** Wynndel, British Columbia, CANADA **
    EMAIL: bob@mellowood.ca
    WWW: http://www.mellowood.ca
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Thu May 8 07:54:34 2025
    From Newsgroup: comp.lang.python

    I think it could be this:
    A backslash-character pair that is not a valid escape sequence now
    generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid
    escape sequence, use raw strings for regular expression: re.compile(r"\d+\.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor
    Stinner in gh-98401.)
    Found in:
    https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
    It's not supposed to crash your program though. If the program crashes
    because of it, it's a bug in Python.
    On Thu, May 8, 2025 at 7:00 AM Bob van der Poel via Python-list <python-list@python.org> wrote:

    Did something change in python buggering up my use of a "\ " sequence in a triple quoted string?

    I have yet to go through my archive on the program, but I tried to run it today and it crashed quite spectacularly when it hit a """ .... """ line being used as a comment at the top of a function. I changed the "\" to a
    "/" and all is well now.


    --

    **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
    Bob van der Poel ** Wynndel, British Columbia, CANADA **
    EMAIL: bob@mellowood.ca
    WWW: http://www.mellowood.ca
    --
    https://mail.python.org/mailman/listinfo/python-list
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Thu May 8 08:05:54 2025
    From Newsgroup: comp.lang.python

    Also, it appears that the change linked above is a lie: https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-python-grammar-longstringitem
    According to the grammar, any character can follow backslash in a
    valid Python program. The warning / error raised by this code should
    not be a syntax error / warning because the syntax is correct.
    On Thu, May 8, 2025 at 7:54 AM Left Right <olegsivokon@gmail.com> wrote:

    I think it could be this:

    A backslash-character pair that is not a valid escape sequence now
    generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid
    escape sequence, use raw strings for regular expression: re.compile(r"\d+\.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

    Found in:
    https://docs.python.org/3/whatsnew/3.12.html#other-language-changes

    It's not supposed to crash your program though. If the program crashes because of it, it's a bug in Python.

    On Thu, May 8, 2025 at 7:00 AM Bob van der Poel via Python-list <python-list@python.org> wrote:

    Did something change in python buggering up my use of a "\ " sequence in a triple quoted string?

    I have yet to go through my archive on the program, but I tried to run it today and it crashed quite spectacularly when it hit a """ .... """ line being used as a comment at the top of a function. I changed the "\" to a "/" and all is well now.


    --

    **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
    Bob van der Poel ** Wynndel, British Columbia, CANADA **
    EMAIL: bob@mellowood.ca
    WWW: http://www.mellowood.ca
    --
    https://mail.python.org/mailman/listinfo/python-list
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.lang.python on Thu May 8 15:46:08 2025
    From Newsgroup: comp.lang.python

    Left Right <olegsivokon@gmail.com> wrote or quoted:
    Also, it appears that the change linked above is a lie:

    The Python documentation is a bit, "informal".

    A "more formal specification" can be found in, maybe (if I found
    the right place), the function definition "_PyBytes_DecodeEscape"
    in the source file "Objects\bytesobject.c":

    |switch (*s++) {
    |/* XXX This assumes ASCII! */
    |case '\n': break;
    |case '\\': *p++ = '\\'; break;
    |case '\'': *p++ = '\''; break;
    |case '\"': *p++ = '\"'; break;
    . . .

    . In 2015, Jakub Przywoski started to write a new specification:

    |Python is such a well-designed, clean and enjoyable to code in
    |language so it sure deserves to have a decent syntax reference.

    . It seems, however, that he was not yet able to finish his project
    or to update it to newer versions of Python. It would be a full-time
    project I think!

    Effectively, Python is what CPython does.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.lang.python on Thu May 8 16:09:35 2025
    From Newsgroup: comp.lang.python

    ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
    A "more formal specification" can be found in, maybe (if I found
    the right place), the function definition "_PyBytes_DecodeEscape"
    in the source file "Objects\bytesobject.c":

    See also:

    Grammar/python.gram
    Grammar/Tokens

    in the CPython sources, which does not seem to speak about
    escapes in string literals, though.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Peter J. Holzer@hjp-python@hjp.at to comp.lang.python on Sun May 11 11:58:58 2025
    From Newsgroup: comp.lang.python


    --l6dx3oqrzzts6slg
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    On 2025-05-08 08:05:54 +0200, Left Right via Python-list wrote:
    Also, it appears that the change linked above is a lie:

    Such strong words ...


    https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-p=
    ython-grammar-longstringitem
    =20
    According to the grammar, any character can follow backslash in a
    valid Python program. The warning / error raised by this code should
    not be a syntax error / warning because the syntax is correct.

    Warnings are about technically correct but probably unintended usage.

    The documentation you linked to describes (a bit further down) which
    escape sequences are recognized and what happens if you use an
    unrecognized escape sequence. It also mentions that using an
    unrecognized escape sequence *will* be an error in future versions of
    Python.

    A warning is appropriate here. It gives the programmer a chance to fix
    the program now before it breaks.

    One could argue that it should say 'unrecognized escape sequence'
    instead of 'invalid escape sequence', since it isn't invalid yet, but
    that's nitpicking.

    hjp

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

    --l6dx3oqrzzts6slg
    Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmggdNsACgkQ8g5IURL+ KF3CiQ/+M1YsR/nTAzRyauQ2RiUTR2hw3J3DFSpXSQhsvKvS7S1uPL1+kkBsoUCC 623bVF+5yrPsjAOJVm0S2ieT0465zvnBzDIqcTvKoNmHbAxc3HNEEUyORZ3PGLzN yG7TyUqTLgoHaMGbxEpPfZLQ3DLrslXVKX9JPpMoeDu5jaGah2fv1Y4opCU62Akj QlQP/9rj9k67CGPSr2ndnDu9fqL6v79p57IUC9/SVKOCCaYTG9Wz+LFIyvybP8qp nEfwU+qZw2tKKEn8r78JlP7WkpqBFV2vtmuvFCFsTYLPD7JHihyq9J8fiG1OKy5V t2EPCcFiXshcIUxgiWoEwhBD8NsuqLsvg9Z3z96BzJ8MDB6S6dbp0sLFOdpQiSPT xL7QRB3LvG8oyW63JNCkhuDhKhAf2yPCfezVAiZfcF6Ef3s+o+dv+L0alEXFTpJ1 YFVMlRv5+n/NLAZP7zdpEiNoRlZceTC955MznS40eK7Zc5QK99tzX1BYEBcTNeNR VmNmYma/a4FRo2mFiPFeAyTlDOOCw7G7a3NvRmchHrqWXTZ+WoPmDq/e1DeuDXgi 69Piv0YvwJ2BrN7Dj30R9DmC1Y8K5swg9aUJJNQw3Hamvzybwk94rhBFn1piViQv YAKAEH7NdGYssMgxEbMcqmCpavTVVen7ZxH4WNQ2BIRhs4iKvdY=
    =k/a9
    -----END PGP SIGNATURE-----

    --l6dx3oqrzzts6slg--
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 12:36:31 2025
    From Newsgroup: comp.lang.python

    Then it just means that the grammar lies. The two claims are mutually exclusive, so either one is a lie or the other or both.
    My comment was more of an irony really. It's plenty obvious that the
    grammar is a lie. The reason is that it's tedious to put the actual
    intender rules into the grammar, and so whoever wrote the grammar
    decided to cut corners. But, the grammar is supposed to be the
    authoritative source for how the language is parsed, that's why even
    though it's clear that the grammar is a lie, blaming whoever doesn't
    follow it makes it ironic.
    In other words, the grammar author didn't put enough effort into
    making grammar actually work, but seeing how many other things are
    done in Python, this is not an exception. It would've been strange to
    have it done properly when "properly" means doing copious amounts of
    tedious work.
    On Sun, May 11, 2025 at 12:11 PM Peter J. Holzer via Python-list <python-list@python.org> wrote:

    On 2025-05-08 08:05:54 +0200, Left Right via Python-list wrote:
    Also, it appears that the change linked above is a lie:

    Such strong words ...


    https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-python-grammar-longstringitem

    According to the grammar, any character can follow backslash in a
    valid Python program. The warning / error raised by this code should
    not be a syntax error / warning because the syntax is correct.

    Warnings are about technically correct but probably unintended usage.

    The documentation you linked to describes (a bit further down) which
    escape sequences are recognized and what happens if you use an
    unrecognized escape sequence. It also mentions that using an
    unrecognized escape sequence *will* be an error in future versions of
    Python.

    A warning is appropriate here. It gives the programmer a chance to fix
    the program now before it breaks.

    One could argue that it should say 'unrecognized escape sequence'
    instead of 'invalid escape sequence', since it isn't invalid yet, but
    that's nitpicking.

    hjp

    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"
    --
    https://mail.python.org/mailman/listinfo/python-list
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris Angelico@rosuav@gmail.com to comp.lang.python on Sun May 11 20:47:52 2025
    From Newsgroup: comp.lang.python

    On Sun, 11 May 2025 at 20:38, Left Right via Python-list <python-list@python.org> wrote:

    My comment was more of an irony really. It's plenty obvious that the
    grammar is a lie. The reason is that it's tedious to put the actual
    intender rules into the grammar, and so whoever wrote the grammar
    decided to cut corners. But, the grammar is supposed to be the
    authoritative source for how the language is parsed, that's why even
    though it's clear that the grammar is a lie, blaming whoever doesn't
    follow it makes it ironic.

    Have you ever built a language parser? I'm going to guess you haven't.

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Richard Damon@richard@damon-family.org to comp.lang.python on Sun May 11 07:16:05 2025
    From Newsgroup: comp.lang.python



    On 05/11/2025 6:36 AM EDT Left Right via Python-list
    <[1]python-list@python.org> wrote:


    Then it just means that the grammar lies. The two claims are mutually
    exclusive, so either one is a lie or the other or both.



    No, it more points out that not all errors are grammatical. The grammar
    does not (and can not) fully define what is a legal program. Some forms of
    error are semantic, like undefined symbols.

    It appears that rather than try to make the grammar complicated enough to
    describe what is a valid string, that operation was moved into the
    semantics of a string, which simplifies the rules quite a bit.

    References

    Visible links
    1. mailto:python-list@python.org
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Peter J. Holzer@hjp-python@hjp.at to comp.lang.python on Sun May 11 17:13:34 2025
    From Newsgroup: comp.lang.python


    --7esxoziucknnix62
    Content-Type: text/plain; charset=iso-8859-1
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    On 2025-05-11 12:36:31 +0200, Left Right via Python-list wrote:
    Then it just means that the grammar lies.

    No, because the parser accepts the sequence. And it produces exactly
    what the description says.

    The program

    #!/usr/bin/python3

    print("start")
    for i in range(3):
    print("\copy")
    print("end")

    is valid and prints

    start
    \copy
    \copy
    \copy
    end

    to stdout, as you would expect from reading the docs.

    But in addition to that it also prints the *warning* (not error, that's
    a difference)

    /home/hjp/tmp/./foo:5: SyntaxWarning: invalid escape sequence '\c'
    print("\copy")

    to stderr (this is also documented).

    One can quibble over the exact wording of the warning ("unrecognized"
    would be more in line with the documentation than "invalid"), but there
    are reasons for the warning.


    The two claims are mutually exclusive, so either one is a lie or the
    other or both.

    No they are not. The grammar says that the program will compile and run,
    which it does. The warning tells you that this probably wasn't a good
    idea.

    Warnings about stuff that is technically correct aren't unusual.
    For example, in C something like=20

    #v+
    int a =3D 5, b =3D 3;
    if (a =3D b) {
    printf("a =3D %d\n", a);
    }
    #v-

    is totally legal (and will print "a =3D 3"). However, most compilers will
    warn about this because it is very likely that the programmer wanted to
    write =ABif (a =3D=3D b) ...=BB.

    My comment was more of an irony really. It's plenty obvious that the
    grammar is a lie. The reason is that it's tedious to put the actual
    intender rules into the grammar, and so whoever wrote the grammar
    decided to cut corners. But, the grammar is supposed to be the
    authoritative source for how the language is parsed,

    Which it is.

    that's why even though it's clear that the grammar is a lie, blaming
    whoever doesn't follow it makes it ironic.
    =20
    In other words, the grammar author didn't put enough effort into
    making grammar actually work,

    But the grammar *does* describe how it actually works. You *can* write
    any character after a backslash, and your programm will compile and run.

    It is likely that in some future version of Python that will not be the
    case any more. *Then* the grammar must be changed. Until then the
    documentation should match the current implementation and not something
    which may or may not be implemented at some point in the future.

    but seeing how many other things are done in Python, this is not an exception. It would've been strange to have it done properly when
    "properly" means doing copious amounts of tedious work.

    As usual you're making up your lack of knowledge with an abundance of
    opinion.

    hjp

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

    --7esxoziucknnix62
    Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmggvpUACgkQ8g5IURL+ KF3XhA//WCebtFiblmx70chiX8tPHbM6bGbkHGK53Gejjn/QCmObeyorApVjMZRN bKuRQrbCnffEXFKC9A6mKV2LqFwqB7aEUQVSZZC9/hyTSUgsYWwowAgPrDzkvNHm vgqLQHFKwHTs+6ysvbf7PiiVTT6w9//3YWhDh30KT/gbppLzXnXWPsLLM111CheF j5Q+vlMZJSKgxdZQjPxBUN7079j2ajuDrwoCgspnGF9MlcnG+37sQ/jDFjlP1gMU Omr9HncQZ3gjjSytU2nvAcn406aufnawy3UamC67DYlUXJotu3UgLYJ/8DwFKDCZ 5XJzd86KxVxKvZXjlNkpOdF2lpnj40IB49ALcfUkiI/cnmf7DBvLbGT346awGfYo vCJPFCWbQgA/D1P8i0fHe65/sXpq5SDtEXADksmGpIh28MBgGCPHjjDobqMwiZ13 xsVYIY+Lr4hKTtzsv3R4OxbKpQFg1CRPr9hZd4rWlQMcXuw1h3To0uaGaxP6NnM6 JcOhU7odDs314E1taG189hgBYHwPjP+DTrEfIiMky59IQcKQfSvoE60vc2JK/ncg eHD+hED4ADJlNDdH9EQCqAw4xeTMYr760MoOmZICXsDQsDmLlhTqxWZRC403I+Wx KzkLYNHvLBMOlIZLjK0LoHShbrnNrvZQyhx1JmlA+DKc4nGac+c=
    =Sw2c
    -----END PGP SIGNATURE-----

    --7esxoziucknnix62--
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 17:19:24 2025
    From Newsgroup: comp.lang.python

    Have you ever built a language parser?

    I've lost count by now. Probably fewer than hundred times though.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 17:21:58 2025
    From Newsgroup: comp.lang.python

    Hahah... what a pile of rubbish. The point is that the error is wrong.
    It cannot be a syntax error and at the same time the program compiles.
    You need to choose one. But, sure, go ahead, foam at the mouth, if it
    makes you feel better about it.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris Angelico@rosuav@gmail.com to comp.lang.python on Mon May 12 01:24:26 2025
    From Newsgroup: comp.lang.python

    On Mon, 12 May 2025 at 01:19, Left Right <olegsivokon@gmail.com> wrote:

    Have you ever built a language parser?

    I've lost count by now. Probably fewer than hundred times though.

    Show me then. Prove it. You're all hot air and opinions and bluster.
    Show some actual code, and show that you can do right what you're
    complaining that Python has done wrong.

    I'm not holding my breath.

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris Angelico@rosuav@gmail.com to comp.lang.python on Mon May 12 01:28:16 2025
    From Newsgroup: comp.lang.python

    On Mon, 12 May 2025 at 01:24, Left Right via Python-list <python-list@python.org> wrote:

    But, sure, go ahead, foam at the mouth, if it
    makes you feel better about it.

    Projecting, much?

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 19:17:29 2025
    From Newsgroup: comp.lang.python

    Oh, so this is where 4chan relocated after they were hacked?
    What a refined discussion!
    On Sun, May 11, 2025 at 5:28 PM Chris Angelico <rosuav@gmail.com> wrote:

    On Mon, 12 May 2025 at 01:24, Left Right via Python-list <python-list@python.org> wrote:

    But, sure, go ahead, foam at the mouth, if it
    makes you feel better about it.

    Projecting, much?

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 19:35:28 2025
    From Newsgroup: comp.lang.python

    https://gitlab.com/doodles-archive/protopy/-/blob/master/protopy/lib/protopy.y?ref_type=heads
    Here's one. It's not great, not awful. https://gitlab.com/doodles-archive/protopy/-/blob/master/cris-angelico-is-a-moron.org?ref_type=heads
    Here's a proof that I have commit rights to this repo
    On Sun, May 11, 2025 at 5:24 PM Chris Angelico <rosuav@gmail.com> wrote:

    On Mon, 12 May 2025 at 01:19, Left Right <olegsivokon@gmail.com> wrote:

    Have you ever built a language parser?

    I've lost count by now. Probably fewer than hundred times though.

    Show me then. Prove it. You're all hot air and opinions and bluster.
    Show some actual code, and show that you can do right what you're
    complaining that Python has done wrong.

    I'm not holding my breath.

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Chris Angelico@rosuav@gmail.com to comp.lang.python on Mon May 12 03:38:06 2025
    From Newsgroup: comp.lang.python

    On Mon, 12 May 2025 at 03:35, Left Right <olegsivokon@gmail.com> wrote:

    https://gitlab.com/doodles-archive/protopy/-/blob/master/cris-angelico-is-a-moron.org?ref_type=heads
    Here's a proof that I have commit rights to this repo


    I didn't ask for that, and you don't even have the respect to spell my
    name correctly.

    You can leave that there, I don't really care. All it really proves is
    that you have zero respect for anyone else.

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Sun May 11 19:45:43 2025
    From Newsgroup: comp.lang.python

    Why of all people would I respect you? What did you ever do other than
    insult me? :) Now you are acting surprised?
    On Sun, May 11, 2025 at 7:38 PM Chris Angelico <rosuav@gmail.com> wrote:

    On Mon, 12 May 2025 at 03:35, Left Right <olegsivokon@gmail.com> wrote:

    https://gitlab.com/doodles-archive/protopy/-/blob/master/cris-angelico-is-a-moron.org?ref_type=heads
    Here's a proof that I have commit rights to this repo


    I didn't ask for that, and you don't even have the respect to spell my
    name correctly.

    You can leave that there, I don't really care. All it really proves is
    that you have zero respect for anyone else.

    ChrisA
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.lang.python on Sun May 11 15:02:37 2025
    From Newsgroup: comp.lang.python

    Left Right <olegsivokon@gmail.com> writes:
    Then it just means that the grammar lies. The two claims are mutually exclusive, so either one is a lie or the other or both.
    [...]

    A couple of points.

    First, the convention in this and most other Usenet newsgroups
    is to write new text *below* any quoted text. This is known as "bottom-posting". The alternative, "top-posting" is common in
    email in some environments, but tends to cause confusion on Usenet.
    It's also a good idea to trim any quoted text that's not relevant to
    your followup. See most of the other followups in this newsgroup,
    including this one, for examples. Even if you happen to prefer
    top-posting, I suggest trying to follow the existing conventions
    observed by the vast majority of participants here.

    Second, the word "lie" is far more harsh than what I presume
    you meant to say. For me, and I think for most people, the word
    "lie" implies a deliberate intent to deceive. I don't think you
    actually believe that the authors of the documentation you're
    complaining about deliberately inserted false information with the
    goal of deceiving readers. If you want to say that the grammar
    is incorrect, or contains an error, that's something that can be
    discussed reasonably. If you say that it "lies", you're making a
    claim of malice and making assumptions about someone else's state
    of mind with no real basis. Perhaps that's not what the word "lie"
    means to you, but I suggest that it explains the harsh reaction to
    your initial statement.
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Greg Ewing@greg.ewing@canterbury.ac.nz to comp.lang.python on Mon May 12 14:32:29 2025
    From Newsgroup: comp.lang.python

    On 12/05/25 3:21 am, Left Right wrote:
    The point is that the error is wrong.
    It cannot be a syntax error and at the same time the program compiles.

    But the message doesn't say it's an error. It uses the word "warning",
    not "error". You're tilting at a straw horse here.
    --
    Greg
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Mon May 12 20:28:00 2025
    From Newsgroup: comp.lang.python

    But the message doesn't say it's an error. It uses the word "warning",
    not "error". You're tilting at a straw horse here.

    Read the associate release note.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Left Right@olegsivokon@gmail.com to comp.lang.python on Mon May 12 20:42:17 2025
    From Newsgroup: comp.lang.python

    Second, the word "lie" is far more harsh than what I presume
    you meant to say. For me, and I think for most people, the word
    "lie" implies a deliberate intent to deceive.

    No, it doesn't. Consider Joseph Conrand's Heart of Darkness, the final
    episode where Marlow comes to Kurtz' widow and tells her about how her
    husband died. He lies to her, but his intent is not to deceive her,
    instead, he intends to make sure that her delusion of her late husband
    is unharmed and that she continues to live that delusion because he
    judges she will be better off for it.

    In fact, you yourself used the word deceit, which is to lie with
    intention to benefit from a lie. But people tell lies for all sorts of
    reasons. People can lie by omission, through embellishment, by
    choosing to focus on less relevant aspects of the event. All of these
    are lies. When a painter mixes white paint into the form shadow of a
    plaster ball, she lies. When Google Maps puts the destination marker
    of the restaurant you have a reservation in in the middle of a sea, it
    lies.

    English literature lessons aside, even if you believe what you believe
    about the meaning of the word, you could at least try to find the
    irony, that was the larger goal, than to immediately presume you are
    being attacked, and start retaliating instead of looking into the
    problem.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Ethan Furman@ethan@stoneleaf.us to comp.lang.python on Mon May 12 10:58:27 2025
    From Newsgroup: comp.lang.python

    Chris and Oleg (sp?), please control your tempers; your latter posts added nothing useful to the conversation.

    (Apologies for the late reply, I was out of town.)

    --
    ~Ethan~
    Moderator
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.lang.python on Mon May 12 13:55:12 2025
    From Newsgroup: comp.lang.python

    Left Right <olegsivokon@gmail.com> writes:
    Second, the word "lie" is far more harsh than what I presume
    you meant to say. For me, and I think for most people, the word
    "lie" implies a deliberate intent to deceive.

    No, it doesn't. Consider Joseph Conrand's Heart of Darkness,

    No, thank you.

    I am trying to help you to understand how people are reacting to
    your posts. I suggested that saying that the grammar is incorrect
    or contains an error would have expressed exactly what you intended
    without triggering hostile reactions, which I'm assuming you
    don't want.

    [...]
    English literature lessons aside, even if you believe what you believe
    about the meaning of the word, you could at least try to find the
    irony, that was the larger goal, than to immediately presume you are
    being attacked, and start retaliating instead of looking into the
    problem.

    I'm not aware that I have been attacked or that I have retaliated.
    (No need to explain why you might think I have.)

    One more thing: your Usenet or email client probably adds an
    attribution line above any quoted text. I urge you to leave it
    in place. It makes the discussion easier to follow, especially for
    those of us who read the comp.lang.python Usenet newsgroup rather
    than the mailing list.

    I do not intend to reply further.
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Greg Ewing@greg.ewing@canterbury.ac.nz to comp.lang.python on Tue May 13 12:11:13 2025
    From Newsgroup: comp.lang.python

    On 13/05/25 6:28 am, Left Right wrote:
    Read the associate release note.

    I take it you're referring to this:

    In a future Python version, SyntaxError will
    eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

    That doesn't contradict what I said. Currently it's a warning. If and
    when it becomes an error, presumably the grammar documentation will be
    updated to reflect that. If it isn't, you'll have cause to complain, but
    not before.
    --
    Greg
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Thomas Passin@list1@tompassin.net to comp.lang.python on Tue May 13 09:34:39 2025
    From Newsgroup: comp.lang.python

    On 5/8/2025 2:05 AM, Left Right via Python-list wrote:
    Also, it appears that the change linked above is a lie:

    https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-python-grammar-longstringitem

    According to the grammar, any character can follow backslash in a
    valid Python program. The warning / error raised by this code should
    not be a syntax error / warning because the syntax is correct.

    "Changed in version 3.12: Unrecognized escape sequences produce a SyntaxWarning. In a future Python version they will be eventually a SyntaxError."

    See https://docs.python.org/3/reference/lexical_analysis.html#strings

    Test case for "\" in triple-quoted string:

    [code]
    def f():
    ... """\hello"""
    <stdin>:2: SyntaxWarning: invalid escape sequence '\h'
    ... print('hi')
    ...

    f()
    hi
    [/code]

    This example fits the documentation exactly. A SyntaxWarning is emitted
    for the unrecognized escape sequence "\h". The program runs as intended.

    Please let's drop all the OT back-and-forth.

    On Thu, May 8, 2025 at 7:54 AM Left Right <olegsivokon@gmail.com> wrote:

    I think it could be this:

    A backslash-character pair that is not a valid escape sequence now
    generates a SyntaxWarning, instead of DeprecationWarning. For example,
    re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid
    escape sequence, use raw strings for regular expression:
    re.compile(r"\d+\.\d+")). In a future Python version, SyntaxError will
    eventually be raised, instead of SyntaxWarning. (Contributed by Victor
    Stinner in gh-98401.)

    Found in:
    https://docs.python.org/3/whatsnew/3.12.html#other-language-changes

    It's not supposed to crash your program though. If the program crashes
    because of it, it's a bug in Python.

    On Thu, May 8, 2025 at 7:00 AM Bob van der Poel via Python-list
    <python-list@python.org> wrote:

    Did something change in python buggering up my use of a "\ " sequence in a >>> triple quoted string?

    I have yet to go through my archive on the program, but I tried to run it >>> today and it crashed quite spectacularly when it hit a """ .... """ line >>> being used as a comment at the top of a function. I changed the "\" to a >>> "/" and all is well now.


    --

    **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
    Bob van der Poel ** Wynndel, British Columbia, CANADA **
    EMAIL: bob@mellowood.ca
    WWW: http://www.mellowood.ca
    --
    https://mail.python.org/mailman/listinfo/python-list

    --- Synchronet 3.21a-Linux NewsLink 1.2