[pypy-commit] pypy default: remove some import *s

alex_gaynor noreply at buildbot.pypy.org
Mon Dec 17 06:49:27 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r59465:9e5a2ddc72f2
Date: 2012-12-16 21:49 -0800
http://bitbucket.org/pypy/pypy/changeset/9e5a2ddc72f2/

Log:	remove some import *s

diff --git a/pypy/rlib/parsing/ebnfparse.py b/pypy/rlib/parsing/ebnfparse.py
--- a/pypy/rlib/parsing/ebnfparse.py
+++ b/pypy/rlib/parsing/ebnfparse.py
@@ -1,15 +1,14 @@
 import py
+
 from pypy.rlib.parsing.parsing import PackratParser, Rule
-from pypy.rlib.parsing.tree import Nonterminal, Symbol, RPythonVisitor
+from pypy.rlib.parsing.tree import Nonterminal, RPythonVisitor
 from pypy.rlib.parsing.codebuilder import Codebuilder
 from pypy.rlib.parsing.regexparse import parse_regex
-import string
-from pypy.rlib.parsing.regex import *
+from pypy.rlib.parsing.regex import StringExpression
 from pypy.rlib.parsing.deterministic import DFA
 from pypy.rlib.parsing.lexer import Lexer, DummyLexer
 from pypy.rlib.objectmodel import we_are_translated
 
-set = py.builtin.set
 
 def make_ebnf_parser():
     NONTERMINALNAME = parse_regex("([a-z]|_)[a-z0-9_]*")
@@ -56,7 +55,7 @@
     assert len(s) == 1
     s = s[0]
     s.visit(visitor)
-    
+
     rules, changes = visitor.get_rules_and_changes()
     maker = TransformerMaker(rules, changes)
     ToAstVisitor = maker.make_transformer()
@@ -88,11 +87,11 @@
         s = parser.parse(tokens)
         if not we_are_translated():
             try:
-                if py.test.config.option.view: 
+                if py.test.config.option.view:
                     s.view()
             except AttributeError:
                 pass
-                
+
         return s
     return parse
 
@@ -162,7 +161,7 @@
             assert change == " " or change == newchange
             result.append((name, newchange))
         return result
-    
+
     def visit_decorated(self, node):
         expansions = node.children[0].visit(self)
         expansions, changes = zip(*expansions)
@@ -360,7 +359,6 @@
 
     def create_returning_code(self, expansion, subchange):
         assert len(expansion) == len(subchange)
-        children = []
         self.emit("children = []")
         for i, (symbol, c) in enumerate(zip(expansion, subchange)):
             if c == "[":
diff --git a/pypy/translator/unsimplify.py b/pypy/translator/unsimplify.py
--- a/pypy/translator/unsimplify.py
+++ b/pypy/translator/unsimplify.py
@@ -1,4 +1,6 @@
-from pypy.objspace.flow.model import *
+from pypy.objspace.flow.model import (Variable, Constant, Block, Link,
+    SpaceOperation, c_last_exception, checkgraph)
+
 
 def copyvar(annotator, v):
     """Make a copy of the Variable v, preserving annotations and concretetype."""
@@ -51,7 +53,7 @@
 
 def split_block(annotator, block, index, _forcelink=None):
     """return a link where prevblock is the block leading up but excluding the
-    index'th operation and target is a new block with the neccessary variables 
+    index'th operation and target is a new block with the neccessary variables
     passed on.
     """
     assert 0 <= index <= len(block.operations)


More information about the pypy-commit mailing list