Skip to content

Commit 1745ad5

Browse files
Ben-Regsebastinas
authored andcommitted
hide properties under type checking
1 parent d1891d2 commit 1745ad5

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

bpython/repl.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -422,28 +422,29 @@ class Repl:
422422
XXX Subclasses should implement echo, current_line, cw
423423
"""
424424

425-
@abstractmethod
426-
@property
427-
def current_line(self):
428-
pass
425+
if TYPE_CHECKING:
426+
@property
427+
@abstractmethod
428+
def current_line(self):
429+
pass
429430

430-
@abstractmethod
431-
@property
432-
def cursor_offset(self):
433-
pass
431+
@property
432+
@abstractmethod
433+
def cursor_offset(self):
434+
pass
434435

435-
@abstractmethod
436-
def reevaluate(self):
437-
pass
436+
@abstractmethod
437+
def reevaluate(self):
438+
pass
438439

439-
@abstractmethod
440-
def reprint_line(
441-
self, lineno: int, tokens: List[Tuple[_TokenType, str]]
442-
) -> None:
443-
pass
440+
@abstractmethod
441+
def reprint_line(
442+
self, lineno: int, tokens: List[Tuple[_TokenType, str]]
443+
) -> None:
444+
pass
444445

445-
# not actually defined, subclasses must define
446-
cpos: int
446+
# not actually defined, subclasses must define
447+
cpos: int
447448

448449
def __init__(self, interp: Interpreter, config: Config):
449450
"""Initialise the repl.

0 commit comments

Comments
 (0)