rspec/rules/S2319/python/rule.adoc

26 lines
507 B
Plaintext

Python has no pre/post increment/decrement operator. For instance, ``x{plus}{plus}`` and ``++x--++`` will fail to parse. More importantly, ``{plus}{plus}x`` and ``++--x++`` will do nothing. To increment a number, simply write ``++x += 1++``.
== Noncompliant Code Example
----
++x # Noncompliant
----
== Compliant Solution
----
x += 1
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]