174174
175175# Authors
176176# =======
177- #
177+ #
178178# - John D Hunter: original author.
179179# - Fernando Perez: refactoring, documentation, cleanups, port to 0.11.
180180# - VáclavŠmilauer <eudoxos-AT-arcig.cz>: Prompt generalizations.
196196import warnings
197197import shutil
198198from io import StringIO
199+ from typing import Any , Dict , Set
199200
200201# Third-party
201202from docutils .parsers .rst import directives
@@ -425,7 +426,7 @@ def process_image(self, decorator):
425426 source_dir = self .source_dir
426427 saveargs = decorator .split (' ' )
427428 filename = saveargs [1 ]
428- # insert relative path to image file in source
429+ # insert relative path to image file in source
429430 # as absolute path for Sphinx
430431 # sphinx expects a posix path, even on Windows
431432 path = pathlib .Path (savefig_dir , filename )
@@ -901,11 +902,11 @@ def custom_doctest(self, decorator, input_lines, found, submitted):
901902
902903class IPythonDirective (Directive ):
903904
904- has_content = True
905- required_arguments = 0
906- optional_arguments = 4 # python, suppress, verbatim, doctest
907- final_argumuent_whitespace = True
908- option_spec = { 'python' : directives .unchanged ,
905+ has_content : bool = True
906+ required_arguments : int = 0
907+ optional_arguments : int = 4 # python, suppress, verbatim, doctest
908+ final_argumuent_whitespace : bool = True
909+ option_spec : Dict [ str , Any ] = { 'python' : directives .unchanged ,
909910 'suppress' : directives .flag ,
910911 'verbatim' : directives .flag ,
911912 'doctest' : directives .flag ,
@@ -915,7 +916,7 @@ class IPythonDirective(Directive):
915916
916917 shell = None
917918
918- seen_docs = set ()
919+ seen_docs : Set = set ()
919920
920921 def get_config_options (self ):
921922 # contains sphinx configuration variables
0 commit comments