msg146070 - (view) |
Author: Eli Bendersky (eli.bendersky) * |
Date: 2011-10-21 09:11 |
Operator <> was removed in Python 3, but still appears in Grammar/Grammar (and hence in Doc/reference/grammar.rst)
Reported by Alexander Ivanyuta on the docs mailing list
|
msg146071 - (view) |
Author: Eli Bendersky (eli.bendersky) * |
Date: 2011-10-21 09:20 |
The relevant code in Parser/parsetok.c is:
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (type == NOTEQUAL) {
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "!=")) {
err_ret->error = E_SYNTAX;
break;
}
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "<>")) {
err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";
err_ret->error = E_SYNTAX;
break;
}
}
#endif
Hmm... I'm too new to remember this joke, but here it presents a practical problem - since Grammar/Grammar is being directly reflected into the documentation (.. literalinclude:: ../../Grammar/Grammar) and thus can confuse.
Is it safe to just remove the whole thing from Grammar/Grammar and correspondingly Parser/parsetok.c ?
|
msg146072 - (view) |
Author: Florent Xicluna (flox) * |
Date: 2011-10-21 09:28 |
This is PEP 401.
"[Because] the != inequality operator ... was a horrible, finger pain inducing mistake, the FLUFL reinstates the <> diamond operator as the sole spelling. This change is important enough to be implemented for, and released in Python 3.1. To help transition to this feature, a new future statement, from __future__ import barry_as_FLUFL has been added."
|
msg146110 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2011-10-21 18:34 |
Probably need a comment in the Grammar file so people know why an
unused operator is in there.
|
msg146111 - (view) |
Author: Benjamin Peterson (benjamin.peterson) * |
Date: 2011-10-21 18:35 |
Or perhaps we don't need joke backward compatibility? (That's nearly 3 years old.)
|
msg146113 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2011-10-21 18:42 |
On Fri, Oct 21, 2011 at 11:35, Benjamin Peterson <report@bugs.python.org> wrote:
>
> Benjamin Peterson <benjamin@python.org> added the comment:
>
> Or perhaps we don't need joke backward compatibility? (That's nearly 3 years old.)
Then you tell the FLUFL that you want to take his precious operator away. =)
|
msg146116 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2011-10-21 19:30 |
On Oct 21, 2011, at 06:35 PM, Benjamin Peterson wrote:
>Benjamin Peterson <benjamin@python.org> added the comment:
>
>Or perhaps we don't need joke backward compatibility? (That's nearly 3 years
>old.)
OTOH, __future__ imports (even jokes) should never be removed.
|
msg146117 - (view) |
Author: Antoine Pitrou (pitrou) * |
Date: 2011-10-21 19:33 |
> OTOH, __future__ imports (even jokes) should never be removed.
But their meaning can be altered?
(as part of another joke if you want :)
|
msg146118 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2011-10-21 19:35 |
On Oct 21, 2011, at 07:33 PM, Antoine Pitrou wrote:
>Antoine Pitrou <pitrou@free.fr> added the comment:
>
>> OTOH, __future__ imports (even jokes) should never be removed.
>
>But their meaning can be altered?
>(as part of another joke if you want :)
Well, you have 6 months to work that out then. :)
|
msg147424 - (view) |
Author: Eli Bendersky (eli.bendersky) * |
Date: 2011-11-11 08:58 |
Attaching a patch with a clarifying comment in Grammar/Grammar. Should be enough for now?
|
msg147447 - (view) |
Author: Brett Cannon (brett.cannon) * |
Date: 2011-11-11 22:04 |
I think the clarification should be enough.
|
msg147509 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-11-12 16:32 |
+1 for a comment too. I’d even make it shorter:
# don't look at <>, it's not a real operator (see PEP 401)
|
msg147519 - (view) |
Author: Eli Bendersky (eli.bendersky) * |
Date: 2011-11-12 18:44 |
Éric, do you feel strongly about the wording, or can I just go ahead and commit my version if I like it more :) ?
|
msg147576 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2011-11-13 23:08 |
New changeset a259511351d9 by Eli Bendersky in branch '3.2':
Clarify the existence of the <> operator in Grammar/Grammar with a comment, for issue 13239
http://hg.python.org/cpython/rev/a259511351d9
New changeset 410115400838 by Eli Bendersky in branch 'default':
Clarify the existence of the <> operator in Grammar/Grammar with a comment. Closes issue 13239
http://hg.python.org/cpython/rev/410115400838
|
msg147592 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-11-14 13:23 |
+# <> isn't actually a valid comparison operator in Python. It's here for the
+# sake of a __future__ import described in PEP 401
If we wanted to be exact, the operator isn’t here for a __future__ import but for a feature enabled by a __future__ import. But I don’t feel strongly about this at all :)
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:22 | admin | set | github: 57448 |
2011-11-14 13:23:41 | eric.araujo | set | messages:
+ msg147592 |
2011-11-13 23:08:23 | python-dev | set | status: open -> closed
nosy:
+ python-dev messages:
+ msg147576
resolution: fixed stage: resolved |
2011-11-12 18:44:23 | eli.bendersky | set | messages:
+ msg147519 |
2011-11-12 16:32:52 | eric.araujo | set | messages:
+ msg147509 |
2011-11-11 22:04:20 | brett.cannon | set | messages:
+ msg147447 |
2011-11-11 08:58:48 | eli.bendersky | set | files:
+ issue13239.patch keywords:
+ patch messages:
+ msg147424
|
2011-10-21 21:47:03 | eric.araujo | set | nosy:
+ eric.araujo
|
2011-10-21 19:35:11 | barry | set | messages:
+ msg146118 |
2011-10-21 19:33:03 | pitrou | set | nosy:
+ pitrou messages:
+ msg146117
|
2011-10-21 19:30:20 | barry | set | messages:
+ msg146116 |
2011-10-21 18:43:00 | brett.cannon | set | messages:
+ msg146113 |
2011-10-21 18:35:49 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages:
+ msg146111
|
2011-10-21 18:34:46 | brett.cannon | set | messages:
+ msg146110 |
2011-10-21 09:28:24 | flox | set | type: behavior
messages:
+ msg146072 nosy:
+ flox |
2011-10-21 09:23:26 | eli.bendersky | set | nosy:
+ fdrake, barry, brett.cannon, ncoghlan
|
2011-10-21 09:20:21 | eli.bendersky | set | messages:
+ msg146071 |
2011-10-21 09:11:20 | eli.bendersky | create | |