Commits

Jonathan Eunice committed f41efe5

tweaked for publication

Comments (0)

Files changed (3)

     print "There are {} things.".format(x)
     print "Nums has {} items: {}".format(len(nums), nums)
     
-(NB in Python 2.6
-one must number each of the ``{}`` placeholders--e.g. ``"Nums has {0} items: {1}"``--
-in order to avoid a ``ValueError: zero length field name in format`` error. Python 2.7
-and later assume the placeholders are sequential.)
+(NB in Python 2.6 one must number each of the ``{}`` placeholders--e.g. ``"Nums
+has {0} items: {1}"``-- in order to avoid a ``ValueError: zero length field name
+in format`` error. Python 2.7 and later assume the placeholders are sequential.)
     
 The more items that are being printed, and the complicated the ``format``
 invocation, the more valuable having it stated in-line becomes. Note that full
 expressions are are supported. They are evaluated in the context of the caller.
 
-There is also a built-in facility, ``show()``, for outputing the current state of
-variables. It is designed for "debugging print statements" that don't require the
-craptastic repetition of ``print "x = {x}".format(x)``. Instead, just::
+``say()`` is the API for standard printing functions. A parallel API,
+``show()``, is for helps rapidly print the current state of variables. It 
+enables
+"debugging print statements" that don't require the craptastic repetition of
+``print "x = {x}".format(x)``. Instead, just::
 
     show(x)
     show(nums)
     x: 12  nums: [0, 1, 2, 3]  len(nums): 4
 
 All of the standard keyword options for ``say()`` work for ``show()`` as well.
-It's a very quick way of adding in debug printing statements.
 
 Printing Where You Like
 =======================
 
 setup(
     name='say',
-    version=verno("0.6"),
+    version=verno("0.604"),
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='Super-simple templated printing. E.g.: say("Hello, {whoever}!", indent=1) or show(x)',

test/test_show.py

     assert show(a, indent='+1') == '    a: 1'
     assert show(a, b, sep='\n') == 'a: 1\nb: 3.141'
 
-@pytest.mark.skipif('True')
 def test_strings():
     assert show('this') == "this"
-    
-    # known bug
-    
-def test_strings2():
     x = 44
     assert show("x = {x}") == 'x = 44'
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.