Commit 37551e27 authored by Xavier Thompson's avatar Xavier Thompson

Fix coding style errors

parent 5bc69aa8
...@@ -950,7 +950,7 @@ class ExprNode(Node): ...@@ -950,7 +950,7 @@ class ExprNode(Node):
self.generate_subexpr_disposal_code(code) self.generate_subexpr_disposal_code(code)
def generate_assignment_code(self, rhs, code, overloaded_assignment=False, def generate_assignment_code(self, rhs, code, overloaded_assignment=False,
exception_check=None, exception_value=None): exception_check=None, exception_value=None):
# Stub method for nodes which are not legal as # Stub method for nodes which are not legal as
# the LHS of an assignment. An error will have # the LHS of an assignment. An error will have
# been reported earlier. # been reported earlier.
...@@ -2430,7 +2430,7 @@ class NameNode(AtomicExprNode): ...@@ -2430,7 +2430,7 @@ class NameNode(AtomicExprNode):
code.put_error_if_unbound(self.pos, entry, self.in_nogil_context) code.put_error_if_unbound(self.pos, entry, self.in_nogil_context)
def generate_assignment_code(self, rhs, code, overloaded_assignment=False, def generate_assignment_code(self, rhs, code, overloaded_assignment=False,
exception_check=None, exception_value=None): exception_check=None, exception_value=None):
#print "NameNode.generate_assignment_code:", self.name ### #print "NameNode.generate_assignment_code:", self.name ###
entry = self.entry entry = self.entry
tracked_state = self.tracked_state tracked_state = self.tracked_state
...@@ -5038,11 +5038,11 @@ class SliceIndexNode(ExprNode): ...@@ -5038,11 +5038,11 @@ class SliceIndexNode(ExprNode):
return self.base.inferable_item_node(index) return self.base.inferable_item_node(index)
def ensure_subexpr_lhs_locked(self, env): def ensure_subexpr_lhs_locked(self, env):
self.base.ensure_lhs_locked(env) self.base.ensure_lhs_locked(env)
if self.start: if self.start:
self.start.ensure_rhs_locked(env) self.start.ensure_rhs_locked(env)
elif self.stop: elif self.stop:
self.stop.ensure_rhs_locked(env) self.stop.ensure_rhs_locked(env)
def may_be_none(self): def may_be_none(self):
base_type = self.base.type base_type = self.base.type
...@@ -5816,7 +5816,7 @@ class SimpleCallNode(CallNode): ...@@ -5816,7 +5816,7 @@ class SimpleCallNode(CallNode):
explicit_cpp_self = None explicit_cpp_self = None
rlocked = False rlocked = False
wlocked = False wlocked = False
tracked_state = True # Something random, anything that is not None tracked_state = True # Something random, anything that is not None
def compile_time_value(self, denv): def compile_time_value(self, denv):
function = self.function.compile_time_value(denv) function = self.function.compile_time_value(denv)
...@@ -6571,7 +6571,7 @@ class InlinedDefNodeCallNode(CallNode): ...@@ -6571,7 +6571,7 @@ class InlinedDefNodeCallNode(CallNode):
some_args_in_temps = True some_args_in_temps = True
arg = arg.coerce_to_temp(env) arg = arg.coerce_to_temp(env)
elif arg.type.is_cyp_class: elif arg.type.is_cyp_class:
if i > 0: # first argument doesn't matter if i > 0: # first argument doesn't matter
some_args_in_temps = True some_args_in_temps = True
arg = arg.coerce_to_temp(env) arg = arg.coerce_to_temp(env)
self.args[i] = arg self.args[i] = arg
...@@ -7640,7 +7640,7 @@ class AttributeNode(ExprNode): ...@@ -7640,7 +7640,7 @@ class AttributeNode(ExprNode):
ExprNode.generate_disposal_code(self, code) ExprNode.generate_disposal_code(self, code)
def generate_assignment_code(self, rhs, code, overloaded_assignment=False, def generate_assignment_code(self, rhs, code, overloaded_assignment=False,
exception_check=None, exception_value=None): exception_check=None, exception_value=None):
self.obj.generate_evaluation_code(code) self.obj.generate_evaluation_code(code)
if self.is_py_attr: if self.is_py_attr:
code.globalstate.use_utility_code( code.globalstate.use_utility_code(
...@@ -11506,7 +11506,7 @@ class BinopNode(ExprNode): ...@@ -11506,7 +11506,7 @@ class BinopNode(ExprNode):
def is_cpp_operation(self): def is_cpp_operation(self):
return (self.operand1.type.is_cpp_class return (self.operand1.type.is_cpp_class
or self.operand2.type.is_cpp_class) or self.operand2.type.is_cpp_class)
def analyse_cpp_py_operation(self, env): def analyse_cpp_py_operation(self, env):
operator = self.operator if not self.inplace else self.operator+"=" operator = self.operator if not self.inplace else self.operator+"="
entry = env.lookup_operator(operator, [self.operand1, self.operand2]) entry = env.lookup_operator(operator, [self.operand1, self.operand2])
...@@ -11514,7 +11514,7 @@ class BinopNode(ExprNode): ...@@ -11514,7 +11514,7 @@ class BinopNode(ExprNode):
self.analyse_cpp_operation(env) self.analyse_cpp_operation(env)
else: else:
self.analyse_py_operation(env) self.analyse_py_operation(env)
def analyse_py_operation(self, env): def analyse_py_operation(self, env):
self.coerce_operands_to_pyobjects(env) self.coerce_operands_to_pyobjects(env)
self.type = self.result_type(self.operand1.type, self.type = self.result_type(self.operand1.type,
......
...@@ -1057,7 +1057,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1057,7 +1057,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if py_attrs: if py_attrs:
code.put_ensure_gil() code.put_ensure_gil()
for attr in py_attrs: for attr in py_attrs:
code.put_init_var_to_py_none(attr, nanny=False); code.put_init_var_to_py_none(attr, nanny=False)
if constructor: if constructor:
code.putln("%s(%s);" % (constructor.cname, ", ".join(arg_names))) code.putln("%s(%s);" % (constructor.cname, ", ".join(arg_names)))
if py_attrs: if py_attrs:
...@@ -1171,9 +1171,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1171,9 +1171,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if e.is_cfunction if e.is_cfunction
and e.from_type and e.from_type
and e.mro_index > 0 and e.mro_index > 0
and not e.type.is_static_method # avoid dealing with static methods for now and not e.type.is_static_method # avoid dealing with static methods for now
and e.name not in ("<init>", "<del>") and e.name not in ("<init>", "<del>")
and not e.type.has_varargs # avoid dealing with varargs for now (is this ever required anyway ?) and not e.type.has_varargs # avoid dealing with varargs for now (is this ever required anyway ?)
] ]
if inherited_methods: if inherited_methods:
code.putln("") code.putln("")
...@@ -1523,7 +1523,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1523,7 +1523,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("}") code.putln("}")
if num_optional_if > 0: if num_optional_if > 0:
opt_arg_guard.putln("if (this->%s != NULL) {" % opt_arg_name) opt_arg_guard.putln("if (this->%s != NULL) {" % opt_arg_name)
code.putln("}") # The check for optional_args != NULL code.putln("}") # The check for optional_args != NULL
else: else:
code.decrease_indent() code.decrease_indent()
for _ in range(num_trylock): for _ in range(num_trylock):
......
...@@ -2674,11 +2674,10 @@ class CFuncDefNode(FuncDefNode): ...@@ -2674,11 +2674,10 @@ class CFuncDefNode(FuncDefNode):
# An error will be produced in the cdef function # An error will be produced in the cdef function
self.overridable = False self.overridable = False
if env.is_cpp_class_scope and env.parent_type.is_cyp_class\ if env.is_cpp_class_scope and env.parent_type.is_cyp_class and not declarator.skipped_self and not self.is_static_method:
and not declarator.skipped_self and not self.is_static_method: # It means we have a cypclass method without the self argument
# It means we have a cypclass method without the self argument # => shout
# => shout error(self.pos, "Cypclass methods must have a self argument")
error(self.pos, "Cypclass methods must have a self argument")
self.declare_cpdef_wrapper(env) self.declare_cpdef_wrapper(env)
self.create_local_scope(env) self.create_local_scope(env)
......
...@@ -2792,7 +2792,7 @@ class CppClassScope(Scope): ...@@ -2792,7 +2792,7 @@ class CppClassScope(Scope):
reified_type = PyrexTypes.CypClassType(reified_name, scope, reified_cname, None, templates = None, lock_mode="nolock") reified_type = PyrexTypes.CypClassType(reified_name, scope, reified_cname, None, templates = None, lock_mode="nolock")
reified_type.namespace = self.type reified_type.namespace = self.type
#reify_base_classes = () #reify_base_classes = ()
reifying_entry = self.declare(reified_name, reified_cname, reified_type, entry.pos, 'extern') # FIXME: visibility reifying_entry = self.declare(reified_name, reified_cname, reified_type, entry.pos, 'extern') # FIXME: visibility
#reified_entry.is_cpp_class = 1 #reified_entry.is_cpp_class = 1
reifying_entry.reified_entry = entry reifying_entry.reified_entry = entry
self.reifying_entries.append(reifying_entry) self.reifying_entries.append(reifying_entry)
...@@ -2841,7 +2841,7 @@ class CppClassScope(Scope): ...@@ -2841,7 +2841,7 @@ class CppClassScope(Scope):
else: else:
ctypename = '_'.join(exploded_name[index:]) ctypename = '_'.join(exploded_name[index:])
break break
known_type = PyrexTypes.simple_c_type(signed, longness, ctypename) known_type = PyrexTypes.simple_c_type(signed, longness, ctypename)
if not known_type: if not known_type:
if stripped_name == "bool": if stripped_name == "bool":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment