rspec/rules/S2709/python/rule.adoc

27 lines
555 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Python interprets ``++False++`` as a "false" boolean value, and ``++True++`` as a "true" boolean value. Assigning them other values could lead to unexpected behaviors.
This rule raises an issue when "True" and "False", with any case, are used as identifiers.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
True = "red" # Noncompliant
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
color = "red" # Noncompliant
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]