@@ -79,9 +79,9 @@ def clear() -> None:
7979 Works for Windows and POSIX, but does not clear the Python Interpreter or PyCharm's Console.
8080 """
8181
82- if os .name == "nt" :
82+ if os .name == "nt" : # pragma: no cover (!Windows)
8383 os .system ("cls" )
84- else :
84+ else : # pragma: no cover (!Linux)
8585 print ("\033 c" , end = '' )
8686
8787
@@ -104,7 +104,7 @@ def interrupt() -> None:
104104 print (f"(Press Ctrl-{ 'C' if os .name == 'nt' else 'D' } to quit at any time.)" )
105105
106106
107- def overtype (* objects , sep : str = ' ' , end : str = '' , file = sys . stdout , flush : bool = False ) -> None :
107+ def overtype (* objects , sep : str = ' ' , end : str = '' , file = None , flush : bool = False ) -> None :
108108 """
109109 Print ``objects`` to the text stream ``file``, starting with ``"\\ r"``, separated by ``sep``
110110 and followed by ``end``.
@@ -236,20 +236,21 @@ def ioctl_GWINSZ(fd):
236236class Echo :
237237 """
238238 Context manager for echoing variable assignments (in CPython).
239+
240+ :param indent: The indentation of the dictionary of variable assignments.
241+ :type indent: str, optional
239242 """
240243
241- def __init__ (self , msg : str , indent : str = " " ):
242- self .msg = msg
244+ def __init__ (self , indent : str = " " ):
243245 self .indent = indent
244246
245247 frame = inspect .currentframe ()
246- if frame is None :
248+ if frame is None : # pragma: no cover
247249 raise ValueError ("Unable to obtain the frame of the caller." )
248250 else :
249251 self .parent_frame = inspect .currentframe ().f_back # type: ignore # TODO
250252
251253 def __enter__ (self ):
252- print (self .msg )
253254 self .locals_on_entry = self .parent_frame .f_locals .copy ()
254255
255256 def __exit__ (self , exc_t , exc_v , tb ):
0 commit comments