1
0
forked from VimPlug/jedi

fix a few annoyances to be quicker to develop now (disabled a few tests for now)

This commit is contained in:
Dave Halter
2014-02-13 15:40:51 +01:00
parent 6939e3e18f
commit 040ea2b735
3 changed files with 35 additions and 8 deletions

View File

@@ -49,15 +49,15 @@ from jedi.parser import token as token_pr
SCOPE_CONTENTS = ['asserts', 'subscopes', 'imports', 'statements', 'returns']
class GetCodeState(object):
"""A helper class for passing the state of get_code in a thread-safe
manner"""
__slots__ = ("last_pos")
__slots__ = ("last_pos",)
def __init__(self):
self.last_pos = (0, 0)
class Base(object):
"""
This is just here to have an isinstance check, which is also used on
@@ -1474,3 +1474,19 @@ class ListComprehension(Base):
statements = self.stmt, self.middle, self.input
code = [s.get_code().replace('\n', '') for s in statements]
return "%s for %s in %s" % tuple(code)
class Operator():
__slots__ = ('operator', '_line', '_column')
def __init__(self, operator, start_pos):
self.operator = operator
self._line = start_pos[0]
self._column = start_pos[1]
@property
def start_pos(self):
return self._column, self._line
def get_code(self):
return self.operator