This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients anthonypjshaw, lys.nikolaou, pablogsal, tim.peters
Date 2021-07-21.05:25:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626845137.28.0.136820069346.issue44692@roundup.psfhosted.org>
In-reply-to
Content
The binary power operator (`**`) has higher precedence than the unary negation operator (`-`).

That is, -x**y groups as -(x**y).

Not a bug - that's how it was designed and how it's documented.

Note that this isn't novel, either. For example, to give just one example of many, that's how Maxima does it too:

(%i1) -2**3;
(%o1) -8
History
Date User Action Args
2021-07-21 05:25:37tim.peterssetrecipients: + tim.peters, anthonypjshaw, lys.nikolaou, pablogsal
2021-07-21 05:25:37tim.peterssetmessageid: <1626845137.28.0.136820069346.issue44692@roundup.psfhosted.org>
2021-07-21 05:25:37tim.peterslinkissue44692 messages
2021-07-21 05:25:37tim.peterscreate