mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 05:11:25 +08:00
More PEP8, minor cleanup
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user