2727import time
2828from typing import Callable , Dict , List , Optional , Tuple , Union
2929
30- from .box import TextBox
30+ from .box import BaseTextBox
3131from .utils import (CursesTextAttributesConstant ,
3232 CursesTextAttributesConstants ,
33+ Numeric ,
3334 TextAttributes ,
3435 _make_chunk )
3536
3637
37- class DialogBox (TextBox ):
38+ class DialogBox (BaseTextBox ):
3839 """This class provides methods and attributs to manage a dialog box.
3940
4041 :param end_dialog_indicator: Character that will be displayed in the
@@ -49,7 +50,7 @@ class DialogBox(TextBox):
4950
5051 .. NOTE::
5152 This class inherits all the methods and attributes of
52- ``TextBox ``.
53+ ``BaseTextBox ``.
5354
5455 .. WARNING::
5556 Parameters ``downtime_chars`` and ``downtime_chars_delay`` do
@@ -109,8 +110,8 @@ def char_by_char(
109110 words_attr : Union [Dict [Tuple [str ], CursesTextAttributesConstant ],
110111 Dict [Tuple [str ], CursesTextAttributesConstants ]] = {},
111112 flash_screen : bool = False ,
112- delay : Union [ int , float ] = .04 ,
113- random_delay : Union [Tuple [int , float ], List [int , float ]] = (0 , 0 ),
113+ delay : Numeric = .04 ,
114+ random_delay : Union [Tuple [Numeric ], List [Numeric ]] = (0 , 0 ),
114115 callback : Callable = lambda : None ,
115116 cargs : Union [Tuple , List ] = ()):
116117 """Writes the given text character by character in the current
@@ -147,13 +148,13 @@ def char_by_char(
147148
148149 :param delay: Waiting time between the writing of each character
149150 of text in second. This defaults to ``0.04``.
150- :type delay: Union[int, float]
151+ :type delay: Numeric
151152
152153 :param random_delay: Waiting time between the writing of each
153154 character in seconds where time waited is a random number
154155 generated in ``random_delay`` interval. This defaults to
155156 ``(0, 0)``.
156- :type random_delay: Union[tuple[int, float ],list[int, float ]]
157+ :type random_delay: Union[tuple[Numeric ],list[Numeric ]]
157158
158159 :param callback: Callable called after writing a character and
159160 the delay time has elapsed. This defaults to a lambda which
@@ -254,8 +255,8 @@ def word_by_word(
254255 words_attr : Union [Dict [Tuple [str ], CursesTextAttributesConstant ],
255256 Dict [Tuple [str ], CursesTextAttributesConstants ]] = {},
256257 flash_screen : bool = False ,
257- delay : Union [ int , float ] = .15 ,
258- random_delay : Union [Tuple [int , float ], List [int , float ]] = (0 , 0 ),
258+ delay : Numeric = .15 ,
259+ random_delay : Union [Tuple [Numeric ], List [Numeric ]] = (0 , 0 ),
259260 callback : Callable = lambda : None ,
260261 cargs : Union [Tuple , List ] = ()):
261262 """Writes the given text word by word at position in the current
@@ -296,13 +297,13 @@ def word_by_word(
296297
297298 :param delay: Waiting time between the writing of each word of
298299 ``text`` in second. This defaults to ``0.15``.
299- :type delay: Union[int, float]
300+ :type delay: Numeric
300301
301302 :param random_delay: Waiting time between the writing of each
302303 word in seconds where time waited is a random number
303304 generated in ``random_delay`` interval. This defaults to
304305 ``(0, 0)``.
305- :type random_delay: Union[tuple[int, float],list[int, float ]]
306+ :type random_delay: Union[Tuple[Numeric], List[Numeric ]]
306307
307308 :param callback: Callable called after writing a word and the
308309 delay time has elapsed. This defaults to a lambda which do
0 commit comments