make a module for typing-related things
This commit is contained in:
6
babi/_types.py
Normal file
6
babi/_types.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Protocol # python3.8+
|
||||
else:
|
||||
Protocol = object
|
||||
@@ -2,12 +2,8 @@ import functools
|
||||
from typing import Callable
|
||||
from typing import Iterator
|
||||
from typing import List
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Protocol # python3.8+
|
||||
else:
|
||||
Protocol = object
|
||||
from babi._types import Protocol
|
||||
|
||||
|
||||
class MutableSequenceNoSlice(Protocol):
|
||||
|
||||
@@ -5,21 +5,16 @@ import shlex
|
||||
import sys
|
||||
from typing import List
|
||||
from typing import NamedTuple
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Union
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from babi._types import Protocol
|
||||
from babi.main import main
|
||||
from babi.screen import VERSION_STR
|
||||
from testing.runner import PrintsErrorRunner
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Protocol
|
||||
else:
|
||||
Protocol = object
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def xdg_data_home(tmpdir):
|
||||
|
||||
Reference in New Issue
Block a user