# Python matrix product operator @ with equal operands triggers "python:S1764"

**URL:** <https://community.sonarsource.com/t/python-matrix-product-operator-with-equal-operands-triggers-python-s1764/8181>\
**Category:** Report False-positive / False-negative...\
**Tags:** python, intellij, sonarqube-ide\
**Created:** [March 27, 2019, 11:59am UTC](https://community.sonarsource.com/t/python-matrix-product-operator-with-equal-operands-triggers-python-s1764/8181 "2019-03-27T11:59:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jle](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jle/32/3098_2.png) [@jle](https://community.sonarsource.com/u/jle)\
**Post date:** [March 27, 2019, 11:59am UTC](https://community.sonarsource.com/t/python-matrix-product-operator-with-equal-operands-triggers-python-s1764/8181/1 "2019-03-27T11:59:36Z")

</div>

Using the latest SonarLint version provided by PyCharm.

When using Python 3.5 matrix operator in an expression of the form `a @ a`, SonarLint detects _major bug python:S1764: Identical expressions should not be used on both sides of a binary operator_.

According to [PEP 456](https://www.python.org/dev/peps/pep-0465/#semantics), there should be no problem in such an expression, unless operand dimensions are incompatible, but that’s not something SonarLint could statically analyze.

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [March 28, 2019, 1:50pm UTC](https://community.sonarsource.com/t/python-matrix-product-operator-with-equal-operands-triggers-python-s1764/8181/2 "2019-03-28T13:50:55Z")

</div>

Hi!

You’re right, this is a false positive.  
We should exclude the `@` operator from that rule, the same way we already exclude the multiplication operator.  
Ticket created : [SONARPY-332](https://jira.sonarsource.com/browse/SONARPY-332)

Thanks a lot for your feedback!

---

<div class="post-metadata">

**Author:** ![jle](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jle/32/3098_2.png) [@jle](https://community.sonarsource.com/u/jle)\
**Post date:** [March 29, 2019, 8:15am UTC](https://community.sonarsource.com/t/python-matrix-product-operator-with-equal-operands-triggers-python-s1764/8181/3 "2019-03-29T08:15:29Z")

</div>

And thank you for this excellent tool.
