MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/doctest.py:556–568  ·  view source on GitHub ↗

Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`.

(self, examples, globs, name, filename, lineno, docstring)

Source from the content-addressed store, hash-verified

554 or `None` if the string is unavailable.
555 """
556 def __init__(self, examples, globs, name, filename, lineno, docstring):
557 """
558 Create a new DocTest containing the given examples. The
559 DocTest's globals are initialized with a copy of `globs`.
560 """
561 assert not isinstance(examples, str), \
562 "DocTest no longer accepts str; use DocTestParser instead"
563 self.examples = examples
564 self.docstring = docstring
565 self.globs = globs.copy()
566 self.name = name
567 self.filename = filename
568 self.lineno = lineno
569
570 def __repr__(self):
571 if len(self.examples) == 0:

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected