1 --- shedskin/lib/builtin.py (revision 1507) 2 +++ shedskin/lib/builtin.py (working copy) 3 @@ -1,5 +1,3 @@ 4 -from __future__ import print_function 5 - 6 class class_: 7 def __repr__(self): 8 return self.__name__ 9 @@ -848,5 +846,5 @@ 10 return iter1.next() 11 return fillvalue 12 13 -def print(__kw_sep=0, __kw_end=0, __kw_file=0, *value): 14 +def __print(__kw_sep=0, __kw_end=0, __kw_file=0, *value): 15 value.__str__() 16 --- shedskin/graph.py (revision 1507) 17 +++ shedskin/graph.py (working copy) 18 @@ -1200,6 +1200,8 @@ 19 elif isinstance(node.node, Name): 20 # direct call 21 ident = node.node.name 22 + if ident == 'print': 23 + ident = node.node.name = '__print' # XXX 24 25 if ident in ['getattr', 'setattr', 'slice', 'type']: 26 error("'%s' function is not supported" % ident, node.node) 27 --- shedskin/cpp.py (revision 1507) 28 +++ shedskin/cpp.py (working copy) 29 @@ -1656,6 +1656,8 @@ 30 return 31 elif ident == 'hash': 32 self.append('hasher(') # XXX cleanup 33 + elif ident == '__print': # XXX 34 + self.append('print(') 35 elif ident == 'isinstance' and isinstance(node.args[1], Name) and node.args[1].name in ['float','int']: 36 error("'isinstance' cannot be used with ints or floats; assuming always true", node, warning=True) 37 self.append('1') 38 @@ -1716,7 +1718,7 @@ 39 objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) 40 target = funcs[0] # XXX 41 42 - print_function = self.library_func(funcs, 'builtin', None, 'print') 43 + print_function = self.library_func(funcs, 'builtin', None, '__print') 44 45 castnull = False # XXX 46 if (self.library_func(funcs, 'random', None, 'seed') or \ 47 --- shedskin/shared.py (revision 1507) 48 +++ shedskin/shared.py (working copy) 49 @@ -764,7 +764,7 @@ 50 missing = formals[len(actuals):-len(func.defaults)] 51 52 skip_defaults = True # XXX 53 - if not func.mv.module.builtin or func.mv.module.ident in ['random', 'itertools', 'datetime', 'ConfigParser', 'csv'] or (func.ident in ('sort','sorted', 'min', 'max', 'print')): 54 + if not func.mv.module.builtin or func.mv.module.ident in ['random', 'itertools', 'datetime', 'ConfigParser', 'csv'] or (func.ident in ('sort','sorted', 'min', 'max', '__print')): 55 if not (func.mv.module.builtin and func.ident == 'randrange'): 56 skip_defaults = False 57