[Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.51,1.52
Jeremy Hylton
jhylton@users.sourceforge.net
Mon, 17 Sep 2001 09:41:04 -0700
Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv15147
Modified Files:
pycodegen.py
Log Message:
support true division
Index: pycodegen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** pycodegen.py 2001/09/14 23:17:55 1.51
--- pycodegen.py 2001/09/17 16:41:02 1.52
***************
*** 162,165 ****
--- 162,166 ----
self.last_lineno = None
self._setupGraphDelegation()
+ self._div_op = "BINARY_DIVIDE"
# XXX set flags based on future features
***************
*** 168,171 ****
--- 169,173 ----
if feature == "division":
self.graph.setFlag(CO_FUTURE_DIVISION)
+ self._div_op = "BINARY_TRUE_DIVIDE"
elif feature == "generators":
self.graph.setFlag(CO_GENERATOR_ALLOWED)
***************
*** 976,980 ****
def visitDiv(self, node):
! return self.binaryOp(node, 'BINARY_DIVIDE')
def visitFloorDiv(self, node):
--- 978,982 ----
def visitDiv(self, node):
! return self.binaryOp(node, self._div_op)
def visitFloorDiv(self, node):