Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'operand': 0.07; 'subject: + ': 0.07; '"+"': 0.09; 'atom': 0.09; 'identifier': 0.09; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'subject:not': 0.11; '"%"': 0.16; '"*"': 0.16; '"-"': 0.16; '"/"': 0.16; '"//"': 0.16; '"and"': 0.16; '"not"': 0.16; '"or"': 0.16; '"~"': 0.16; '::=': 0.16; '["**"': 0.16; 'a_expr': 0.16; 'and_test': 0.16; 'attributeref': 0.16; 'bug,': 0.16; 'dict_display': 0.16; 'list_display': 0.16; 'm_expr': 0.16; 'not_test': 0.16; 'or_test': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'surprising': 0.16; 'u_expr': 0.16; 'wrote:': 0.16; 'stefan': 0.18; 'language': 0.19; '2015': 0.20; 'lawrence': 0.22; 'am,': 0.23; 'sat,': 0.23; 'written': 0.24; 'header:In-Reply- To:1': 0.24; 'url:bugs': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'comparison': 0.29; 'primary': 0.31; 'language.': 0.32; 'possibly': 0.32; 'url:python': 0.33; 'ram': 0.33; 'so,': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'does': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'still': 0.40; 'behavior': 0.61; 'our': 0.64; 'skip:\xc2 10': 0.67; 'jul': 0.72; 'power': 0.72; 'pythonistas,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: 0 + not 0 Date: Sat, 11 Jul 2015 21:05:13 +0100 References: <01ec6551-1f40-42b0-9406-036030591519@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-78-147-180-164.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1436645136 news.xs4all.nl 2841 [2001:888:2000:d::a6]:38899 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93701 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_expr "//" u_expr | m_expr "/" u_expr | m_expr "%" u_expr >> u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr >> power ::= primary ["**" u_expr] >> primary ::= atom | attributeref | subscription | slicing | call >> atom ::= identifier | literal | enclosure >> enclosure ::= parenth_form | list_display | dict_display | set_display | generator_expression | yield_atom >> >> How can there be a »not«? >> >> »not« is used in >> >> not_test ::= comparison | "not" not_test >> and_test ::= not_test | and_test "and" not_test >> or_test ::= and_test | or_test "or" and_test >> conditional_expression ::= or_test ["if" or_test "else" expression] >> expression_nocond ::= or_test | lambda_expr_nocond >> expression ::= conditional_expression | lambda_expr >> >> , but an »expression« is not an »m_expr«. > > 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. > http://bugs.python.org/issue24612 -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence