35 lines
588 B
Plaintext
35 lines
588 B
Plaintext
This rule raises an issue when the print statement is used.
|
|
|
|
== Why is this an issue?
|
|
|
|
The ``++print++`` statement was removed in Python 3.0. The built-in function should be used instead.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
print '1' # Noncompliant
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python,diff-id=1,diff-type=compliant]
|
|
----
|
|
print('1')
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Use the "print()" function instead.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|