From 55aeeb00b7f03e8d8d2410d455f51c20c8f089de Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 20 Oct 2012 23:42:39 +0200 Subject: [PATCH] Don't assign to `str` --- jedi/parsing.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/jedi/parsing.py b/jedi/parsing.py index 0c1b9797..a2107a1d 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -326,16 +326,16 @@ class Class(Scope): self.decorators = [] def get_code(self, first_indent=False, indention=" "): - str = "\n".join('@' + stmt.get_code() for stmt in self.decorators) - str += 'class %s' % (self.name) + string = "\n".join('@' + stmt.get_code() for stmt in self.decorators) + string += 'class %s' % (self.name) if len(self.supers) > 0: sup = ','.join(stmt.code for stmt in self.supers) - str += '(%s)' % sup - str += ':\n' - str += super(Class, self).get_code(True, indention) + string += '(%s)' % sup + string += ':\n' + string += super(Class, self).get_code(True, indention) if self.is_empty(): - str += "pass\n" - return str + string += "pass\n" + return string class Function(Scope): @@ -368,13 +368,13 @@ class Function(Scope): self.annotation = annotation def get_code(self, first_indent=False, indention=" "): - str = "\n".join('@' + stmt.get_code() for stmt in self.decorators) + string = "\n".join('@' + stmt.get_code() for stmt in self.decorators) params = ','.join([stmt.code for stmt in self.params]) - str += "def %s(%s):\n" % (self.name, params) - str += super(Function, self).get_code(True, indention) + string += "def %s(%s):\n" % (self.name, params) + string += super(Function, self).get_code(True, indention) if self.is_empty(): - str += "pass\n" - return str + string += "pass\n" + return string def get_set_vars(self): n = super(Function, self).get_set_vars() @@ -441,11 +441,11 @@ class Flow(Scope): for s in self.inits: stmts.append(s.get_code(new_line=False)) stmt = ', '.join(stmts) - str = "%s %s:\n" % (self.command, vars, stmt) - str += super(Flow, self).get_code(True, indention) + string = "%s %s:\n" % (self.command, vars, stmt) + string += super(Flow, self).get_code(True, indention) if self.next: - str += self.next.get_code() - return str + string += self.next.get_code() + return string def get_set_vars(self, is_internal_call=False): """