Ian Kelly wrote:
I must concur. The grammar as written does not actually produce 1 +
not 0. I think it's still worthwhile opening a bug, because the
behavior is surprising and possibly not intentional.
It's almost certainly intentional. If you want
not a + b > c
to be interpreted as
no
On Sat, Jul 11, 2015, at 07:20, Chris Angelico wrote:
> On Sat, Jul 11, 2015 at 9:12 PM, Luuk wrote:
> > It can occur in an arithmetic expression, and 'not' has a higher precedence
> > than '+'
> > (https://docs.python.org/2/reference/expressions.html#operator-precedence)
> >
>
> I think you're m
On 11/07/2015 17:56, Ian Kelly wrote:
On Sat, Jul 11, 2015 at 10:02 AM, Stefan Ram wrote:
I look at Python 3.4.3:
a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr
So, »not 0« must be an »m_expr« when used as the right operand of »+«.
m_expr ::= u_expr | m_expr "*" u_expr | m
On Sat, Jul 11, 2015 at 10:02 AM, Stefan Ram wrote:
> I look at Python 3.4.3:
>
> a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr
>
> So, »not 0« must be an »m_expr« when used as the right operand of »+«.
>
> m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/"
On 2015-07-11 17:02, Stefan Ram wrote:
Serhiy Storchaka writes:
On 11.07.15 13:26, candide wrote:
0 + not 0
File "", line 1
0 + not 0
^
SyntaxError: invalid syntax
What is syntactically wrong with 0 + not 0?
This looks as a bug to me. Please file a report
Le samedi 11 juillet 2015 15:38:51 UTC+2, Serhiy Storchaka a écrit :
> This looks as a bug to me. Please file a report on http://bugs.python.org.
OK, I'll report.
--
https://mail.python.org/mailman/listinfo/python-list
On 11.07.15 13:26, candide wrote:
0 + not 0
File "", line 1
0 + not 0
^
SyntaxError: invalid syntax
What is syntactically wrong with 0 + not 0?
This looks as a bug to me. Please file a report on http://bugs.python.org.
--
https://mail.python.org/mailma
Le samedi 11 juillet 2015 14:05:58 UTC+2, Chris Angelico a écrit :
> You'll see down below a footnote referring to this as a special case.
I didn't spot the footnote and I don't regard it as dealing with a "special
case": the footnote is paraphrasing the precedence hierarchy given by the
table.
On Sat, Jul 11, 2015 at 9:54 PM, candide wrote:
> Le samedi 11 juillet 2015 13:31:03 UTC+2, Luuk a écrit :
>
>>
>> But operator precedence of 'not' is higher than of '+'
>
>
> Right but what does this prove? For instance, unary minus has higher
> precedence than exponentiation but the expres
Le samedi 11 juillet 2015 13:31:03 UTC+2, Luuk a écrit :
>
> But operator precedence of 'not' is higher than of '+'
Right but what does this prove? For instance, unary minus has higher precedence
than exponentiation but the expression
2 ** -1
doesn't raise a syntax error.
--
https://ma
Le samedi 11 juillet 2015 13:21:03 UTC+2, Chris Angelico a écrit :
> I think you're misreading the table; 'not' has *lower* precedence than '+'.
>
Right but Python docs helps a lot in misreading ;) Following the iconicity
principle, it's pretty obvious that one has to display table priority beg
On 11-7-2015 13:20, Chris Angelico wrote:
On Sat, Jul 11, 2015 at 9:12 PM, Luuk wrote:
It can occur in an arithmetic expression, and 'not' has a higher precedence
than '+'
(https://docs.python.org/2/reference/expressions.html#operator-precedence)
I think you're misreading the table; 'not' ha
On Sat, Jul 11, 2015 at 9:12 PM, Luuk wrote:
> It can occur in an arithmetic expression, and 'not' has a higher precedence
> than '+'
> (https://docs.python.org/2/reference/expressions.html#operator-precedence)
>
I think you're misreading the table; 'not' has *lower* precedence than '+'.
> But,
On 11-7-2015 12:38, Irmen de Jong wrote:
On 11-7-2015 12:26, candide wrote:
0 + not 0
File "", line 1
0 + not 0
^
SyntaxError: invalid syntax
What is syntactically wrong with 0 + not 0?
I would say that the boolean operator 'not' cannot oc
On 11-7-2015 12:26, candide wrote:
>>>> 0 + not 0
> File "", line 1
> 0 + not 0
> ^
> SyntaxError: invalid syntax
>>>>
>
>
> What is syntactically wrong with 0 + not 0?
>
I would say that the boolean operator 'not
On Sat, Jul 11, 2015 at 8:26 PM, candide wrote:
>>>> 0 + not 0
> File "", line 1
> 0 + not 0
> ^
> SyntaxError: invalid syntax
>>>>
>
>
> What is syntactically wrong with 0 + not 0?
I'm actually not sure why thi
>>> 0 + not 0
File "", line 1
0 + not 0
^
SyntaxError: invalid syntax
>>>
What is syntactically wrong with 0 + not 0?
--
https://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo