summaryrefslogtreecommitdiff
path: root/test/scanners/python/python3.in.py
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-04-22 02:40:04 +0000
committermurphy <murphy@rubychan.de>2009-04-22 02:40:04 +0000
commit59b31ae8596f9606217b09d4e3f00dcf5aab8475 (patch)
treec1eaef9b3c98f48c449cd84a59c751528f7c45b5 /test/scanners/python/python3.in.py
parenta40476dc4a91737182f78fe939e1d91bd644ea99 (diff)
downloadcoderay-59b31ae8596f9606217b09d4e3f00dcf5aab8475.tar.gz
Improved Python scanner (issue #41).
* fixed numeric literals * better Python 3 support * bugfixes, optimizations * added two more test files
Diffstat (limited to 'test/scanners/python/python3.in.py')
-rw-r--r--test/scanners/python/python3.in.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/scanners/python/python3.in.py b/test/scanners/python/python3.in.py
new file mode 100644
index 0000000..178a798
--- /dev/null
+++ b/test/scanners/python/python3.in.py
@@ -0,0 +1,19 @@
+Old: print "The answer is", 2*2
+New: print("The answer is", 2*2)
+
+Old: print x, # Trailing comma suppresses newline
+New: print(x, end=" ") # Appends a space instead of a newline
+
+Old: print # Prints a newline
+New: print() # You must call the function!
+
+Old: print >>sys.stderr, "fatal error"
+New: print("fatal error", file=sys.stderr)
+
+Old: print (x, y) # prints repr((x, y))
+New: print((x, y)) # Not the same as print(x, y)!
+
+print("There are <", 2**32, "> possibilities!", sep="")
+
+
+b"byte string\99\"" \ No newline at end of file