Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use print() as a function #178

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Use print as a function"
This reverts commit 3a98142.
  • Loading branch information
bst-gbr committed Nov 21, 2021
commit d609b5098e5a8ca016fc902a2da086c15bd84403
6 changes: 3 additions & 3 deletions smop/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# for py2: make PYTHON=python CYTHON="cython" V=2
# for py3: make PYTHON=python3 CYTHON="cython -3" V=3

OCTAVE = /home/lei/octave-4.0.2
SCRIPTS = $(OCTAVE)/scripts/specfun

CYTHON = cython -3
PYTHON = python3
CYTHON = cython
PYTHON = python
XFILES = -x inputParser.m,dblquad.m,triplequad.m

COVERAGE = python3 -m coverage
Expand Down
2 changes: 1 addition & 1 deletion smop/callgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def callgraph(G, stmt_list):
#nx.write_dot(G,"G.dot")
#for u in G.nodes():
# if G.out_degree(u) == 0:
# print(u)
# print u
if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion smop/libsmop.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __new__(cls, a=[]):
a : list, ndarray, matlabarray, etc.

>>> a=cellarray([123,"hello"])
>>> print(a.shape)
>>> print a.shape
(1, 2)

>>> print a[1]
Expand Down
4 changes: 0 additions & 4 deletions smop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,3 @@ def main():
pass
if nerrors:
print("Errors:", nerrors)


if __name__ == "__main__":
main()
8 changes: 4 additions & 4 deletions smop/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def p_persistent_stmt(p):
# else:
# assert p[2].__class__ in (node.let,node.ident), p[2].__class__
# p[0] = p[2]
# #print(p[2])
# #print p[2]


@exceptions
Expand Down Expand Up @@ -739,7 +739,7 @@ def p_stmt(p):
"""
# END_STMT is intentionally left out
p[0] = p[1]
# print(p[0])
# print p[0]


@exceptions
Expand Down Expand Up @@ -830,7 +830,7 @@ def p_error(p):
if p is None:
raise_exception(SyntaxError, "Unexpected EOF", new_lexer)
if p.type == "COMMENT":
# print("Discarded comment", p.value)
# print "Discarded comment", p.value
parser.errok()
return
raise_exception(SyntaxError,
Expand Down Expand Up @@ -869,5 +869,5 @@ def parse(buf):
#
# if "2" in options.debug:
# for i,pi in enumerate(p):
# print(i,pi.__class__.__name__,str(pi)[:50])
# print i,pi.__class__.__name__,str(pi)[:50]

2 changes: 1 addition & 1 deletion smop/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def resolve(t, symtab=None, fp=None, func_name=None):
pass
elif G.out_edges(n) and G.in_edges(n):
u.props = "U" # upd
#print(u.name, u.lineno, u.column)
#print u.name, u.lineno, u.column
elif G.in_edges(n):
u.props = "D" # def
elif G.out_edges(n):
Expand Down
2 changes: 1 addition & 1 deletion smop/rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def let_statement(u):
# for nodename in component:
# G.node[nodename]["ident"].props += "S" # sparse
# #S = G.subgraph(nbunch)
# #print(S.edges())
# #print S.edges()
# return G


Expand Down
4 changes: 2 additions & 2 deletions smop/test_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def test040(self):
def test042(self):
"backslash-newline continues a line"
s = "foo \\\n bar ... hello\n bzz"
#print(43,`s`)
#print('#', s.count('\n'))
#print 43,`s`
#print '#', s.count('\n')
self.lexer.input(s)
# line continuation
t = [tok.type for tok in self.lexer]
Expand Down
4 changes: 2 additions & 2 deletions smop/test_matlabarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test030(self):
a[a.shape[0]+1,1:3] = 123
a[a.shape[0]+1,1:3] = 123
a[a.shape[0]+1,1:3] = 123
#print(a.shape)
#print a.shape
self.assertTrue(isequal (a, [[123,123,123],
[123,123,123],
[123,123,123]]))
Expand Down Expand Up @@ -164,7 +164,7 @@ def test100(self):
def test110(self):
a = zeros (4,4,dtype=int)
a[2:3,2:3] = 1
#print(a)
#print a
self.assertTrue(isequal (a,[[0,0,0,0],
[0,1,1,0],
[0,1,1,0],
Expand Down
2 changes: 1 addition & 1 deletion smop/test_primes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import liboctave
print (liboctave.primes(10000))
print liboctave.primes(10000)