Skip to content

Commit e074bc0

Browse files
committed
Replace useless Numeric type hint by Number from numbers module.
1 parent d84703e commit e074bc0

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

visualdialog/box.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
import curses
2525
import curses.textpad
26+
from numbers import Number
2627
from typing import List, Tuple, Union
2728

2829
from .utils import (CursesKeyConstant,
2930
CursesKeyConstants,
3031
CursesTextAttributesConstant,
3132
CursesTextAttributesConstants,
3233
CursesWindow,
33-
Numeric,
3434
TextAttributes)
3535

3636

@@ -105,7 +105,7 @@ def __init__(
105105
CursesTextAttributesConstants] = curses.A_BOLD,
106106
downtime_chars: Union[Tuple[str],
107107
List[str]] = (",", ".", ":", ";", "!", "?"),
108-
downtime_chars_delay: Numeric = .6):
108+
downtime_chars_delay: Number = .6):
109109
self.pos_x, self.pos_y = pos_x, pos_y
110110
self.length, self.width = length, width
111111

visualdialog/dialog.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__all__ = ["DialogBox"]
2323

2424
import curses
25+
from numbers import Number
2526
import random
2627
import textwrap
2728
import time
@@ -31,7 +32,6 @@
3132
from .utils import (CursesTextAttributesConstant,
3233
CursesTextAttributesConstants,
3334
CursesWindow,
34-
Numeric,
3535
TextAttributes,
3636
_make_chunk)
3737

@@ -71,7 +71,7 @@ def __init__(
7171
CursesTextAttributesConstants] = curses.A_BOLD,
7272
downtime_chars: Union[Tuple[str],
7373
List[str]] = (",", ".", ":", ";", "!", "?"),
74-
downtime_chars_delay: Numeric = .6,
74+
downtime_chars_delay: Number = .6,
7575
end_indicator: str = "►"):
7676
BaseTextBox.__init__(self,
7777
pos_x, pos_y,
@@ -127,8 +127,8 @@ def char_by_char(
127127
words_attr: Union[Dict[Tuple[str], CursesTextAttributesConstant],
128128
Dict[Tuple[str], CursesTextAttributesConstants]] = {},
129129
flash_screen: bool = False,
130-
delay: Numeric = .04,
131-
random_delay: Union[Tuple[Numeric], List[Numeric]] = (0, 0),
130+
delay: Number = .04,
131+
random_delay: Union[Tuple[Number], List[Number]] = (0, 0),
132132
callback: Callable = lambda: None,
133133
cargs: Union[Tuple, List] = ()):
134134
"""Writes the given text character by character in the current
@@ -266,8 +266,8 @@ def word_by_word(
266266
words_attr: Union[Dict[Tuple[str], CursesTextAttributesConstant],
267267
Dict[Tuple[str], CursesTextAttributesConstants]] = {},
268268
flash_screen: bool = False,
269-
delay: Numeric = .15,
270-
random_delay: Union[Tuple[Numeric], List[Numeric]] = (0, 0),
269+
delay: Number = .15,
270+
random_delay: Union[Tuple[Number], List[Number]] = (0, 0),
271271
callback: Callable = lambda: None,
272272
cargs: Union[Tuple, List] = ()):
273273
"""Writes the given text word by word at position in the current

visualdialog/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
Union)
2626

2727

28-
Numeric = TypeVar("Numeric", int, float)
29-
3028
CursesWindow = _curses.window
3129

3230
#: curses text attribute constants are integers.

0 commit comments

Comments
 (0)