@@ -193,7 +193,7 @@ def __ne__(self, other):
193193 """
194194 return not (self == other )
195195
196- def _process_doc (self , doctests , doc , namespace , start ):
196+ def _process_doc (self , doctests : list [ doctest . DocTest ] , doc , namespace , start ):
197197 """
198198 Appends doctests defined in ``doc`` to the list ``doctests``.
199199
@@ -266,7 +266,7 @@ def file_optional_tags(self):
266266 """
267267 return set ()
268268
269- def _create_doctests (self , namespace , tab_okay = None ):
269+ def _create_doctests (self , namespace , tab_okay = None ) -> tuple [ list [ doctest . DocTest ], dict ] :
270270 """
271271 Create a list of doctests defined in this source.
272272
@@ -314,7 +314,7 @@ def _create_doctests(self, namespace, tab_okay=None):
314314 probed_tags = self .options .probe ,
315315 file_optional_tags = self .file_optional_tags )
316316 self .linking = False
317- doctests = []
317+ doctests : list [ doctest . DocTest ] = []
318318 in_docstring = False
319319 unparsed_doc = False
320320 doc = []
@@ -480,7 +480,7 @@ def __iter__(self):
480480 for lineno , line in enumerate (self .source .split ('\n ' )):
481481 yield lineno + self .lineno_shift , line + '\n '
482482
483- def create_doctests (self , namespace ):
483+ def create_doctests (self , namespace ) -> tuple [ list [ doctest . DocTest ], dict ] :
484484 r"""
485485 Create doctests from this string.
486486
@@ -492,8 +492,8 @@ def create_doctests(self, namespace):
492492
493493 - ``doctests`` -- list of doctests defined by this string
494494
495- - ``tab_locations `` -- either ``False `` or a list of linenumbers
496- on which tabs appear
495+ - ``extras `` -- dictionary with ``extras['tab'] `` either
496+ ``False`` or a list of linenumbers on which tabs appear
497497
498498 EXAMPLES::
499499
@@ -503,10 +503,12 @@ def create_doctests(self, namespace):
503503 sage: s = "'''\n sage: 2 + 2\n 4\n'''"
504504 sage: PythonStringSource = dynamic_class('PythonStringSource',(StringDocTestSource, PythonSource))
505505 sage: PSS = PythonStringSource('<runtime>', s, DocTestDefaults(), 'runtime')
506- sage: dt, tabs = PSS.create_doctests({})
506+ sage: dt, extras = PSS.create_doctests({})
507507 sage: for t in dt:
508508 ....: print("{} {}".format(t.name, t.examples[0].sage_source))
509509 <runtime> 2 + 2
510+ sage: extras
511+ {...'tab': []...}
510512 """
511513 return self ._create_doctests (namespace )
512514
@@ -736,7 +738,7 @@ def file_optional_tags(self):
736738 from .parsing import parse_file_optional_tags
737739 return parse_file_optional_tags (self )
738740
739- def create_doctests (self , namespace ):
741+ def create_doctests (self , namespace ) -> tuple [ list [ doctest . DocTest ], dict ] :
740742 r"""
741743 Return a list of doctests for this file.
742744
@@ -910,7 +912,7 @@ class SourceLanguage:
910912
911913 Currently supported languages include Python, ReST and LaTeX.
912914 """
913- def parse_docstring (self , docstring , namespace , start ):
915+ def parse_docstring (self , docstring , namespace , start ) -> list [ doctest . DocTest ] :
914916 """
915917 Return a list of doctest defined in this docstring.
916918
0 commit comments