More PEP8, minor cleanup

This commit is contained in:
Laurens Van Houtven
2013-06-22 09:54:18 +02:00
parent ae94a2cda1
commit cb4acccfe5
3 changed files with 7 additions and 3 deletions

View File

@@ -327,6 +327,7 @@ class Scope(Simple, IsScope):
return "<%s: %s@%s-%s>" % (type(self).__name__, name, return "<%s: %s@%s-%s>" % (type(self).__name__, name,
self.start_pos[0], self.end_pos[0]) self.start_pos[0], self.end_pos[0])
def _enables_absolute_import(imp): def _enables_absolute_import(imp):
""" """
Checks if the import is a ``__future__`` import that enables the Checks if the import is a ``__future__`` import that enables the
@@ -335,13 +336,14 @@ def _enables_absolute_import(imp):
namespace, feature = imp.from_ns.names[0], imp.namespace.names[0] namespace, feature = imp.from_ns.names[0], imp.namespace.names[0]
return namespace == "__future__" and feature == "absolute_import" return namespace == "__future__" and feature == "absolute_import"
class Module(IsScope): class Module(IsScope):
""" For isinstance checks. fast_parser.Module also inherits from this. """ """
pass For isinstance checks. fast_parser.Module also inherits from this.
"""
class SubModule(Scope, Module): class SubModule(Scope, Module):
""" """
The top scope, which is always a module. The top scope, which is always a module.
Depending on the underlying parser this may be a full module or just a part Depending on the underlying parser this may be a full module or just a part

View File

@@ -9,5 +9,6 @@ from __future__ import absolute_import
import unittest # this is stdlib unittest, but jedi gets the local one import unittest # this is stdlib unittest, but jedi gets the local one
class Assertions(unittest.TestCase): class Assertions(unittest.TestCase):
pass pass

View File

@@ -8,6 +8,7 @@ will get this module again, causing infinite recursion.
""" """
from local_module import Assertions from local_module import Assertions
class TestCase(Assertions): class TestCase(Assertions):
def test(self): def test(self):
self.assertT self.assertT