From: ellson Date: Fri, 2 Nov 2007 17:11:20 +0000 (+0000) Subject: indicate "gv.ok(obj)" can be replaced by "obj" in languages that accept pointers... X-Git-Tag: LAST_LIBGRAPH~32^2~5097 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=466075c1afda47015ff24d484ac7cfda9a34274d;p=graphviz indicate "gv.ok(obj)" can be replaced by "obj" in languages that accept pointers as booleans --- diff --git a/tclpkg/gv/examples/layout.py b/tclpkg/gv/examples/layout.py index 9c6a21ae3..8f836acd9 100755 --- a/tclpkg/gv/examples/layout.py +++ b/tclpkg/gv/examples/layout.py @@ -21,10 +21,11 @@ gv.render(G) # do something with the layout n = gv.firstnode(G) -while gv.ok(n) : +# while gv.ok(n) : << gv.ok() is not needed as python accepts pointers as boolean +while n : print 'node '+gv.nameof(n)+' is at '+gv.getv(n,'pos') e = gv.firstout(n) - while gv.ok(e) : + while e : print 'edge '+gv.nameof(gv.tailof(e))+'->'+gv.nameof(gv.headof(e))+' is at '+gv.getv(e,'pos') e = gv.nextout(n,e) n = gv.nextnode(G,n)