From 8cd71f089c4f2d7fd7343911f6b4952165e3969a Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Wed, 7 Jul 2010 01:06:43 -0700 Subject: [PATCH] Various cosmetic touch-ups. --- Cython/Compiler/ExprNodes.py | 9 ++++----- Cython/Compiler/Optimize.py | 5 +++-- Cython/Compiler/PyrexTypes.py | 2 +- Cython/Compiler/TypeInference.py | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 7239c635..7dbaf917 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5337,13 +5337,12 @@ class PowNode(NumBinopNode): self.operand2.result()) -# Note: This class is temporary "shut down" into an ineffective mode temp +# Note: This class is temporarily "shut down" into an ineffective temp # allocation mode. # -# More sophisticated temp reuse was going on before, -# one could have a look at adding this again after /all/ classes -# are converted to the new temp scheme. (The temp juggling cannot work -# otherwise). +# More sophisticated temp reuse was going on before, one could have a +# look at adding this again after /all/ classes are converted to the +# new temp scheme. (The temp juggling cannot work otherwise). class BoolBinopNode(ExprNode): # Short-circuiting boolean operation. # diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 8eb1e92d..4a77e694 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1444,8 +1444,9 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform): elif len(pos_args) != 1: self._error_wrong_arg_count('bool', node, pos_args, '0 or 1') return node - return pos_args[0].coerce_to_boolean( - self.current_env()).coerce_to_pyobject(self.current_env()) + else: + return pos_args[0].coerce_to_boolean( + self.current_env()).coerce_to_pyobject(self.current_env()) ### builtin functions diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index f76922bb..f1ad4eaf 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -2426,7 +2426,7 @@ def independent_spanning_type(type1, type2): elif (type1 is c_bint_type or type2 is c_bint_type) and (type1.is_numeric and type2.is_numeric): # special case: if one of the results is a bint and the other # is another C integer, we must prevent returning a numeric - # type so that we do not loose the ability to coerce to a + # type so that we do not lose the ability to coerce to a # Python bool if we have to. return py_object_type span_type = _spanning_type(type1, type2) diff --git a/Cython/Compiler/TypeInference.py b/Cython/Compiler/TypeInference.py index e0daaabc..2b865b50 100644 --- a/Cython/Compiler/TypeInference.py +++ b/Cython/Compiler/TypeInference.py @@ -296,7 +296,8 @@ def find_spanning_type(type1, type2): return py_object_type else: result_type = PyrexTypes.spanning_type(type1, type2) - if result_type in (PyrexTypes.c_double_type, PyrexTypes.c_float_type, Builtin.float_type): + if result_type in (PyrexTypes.c_double_type, PyrexTypes.c_float_type, + Builtin.float_type): # Python's float type is just a C double, so it's safe to # use the C type instead return PyrexTypes.c_double_type -- 2.26.2