Hello,
I understand that you want to share data across examples (docstrings)
because you are running doctest to validate them (and test).
The doctest implementation evaluates each docstring separately without
sharing the context so the short answer is "no".
This is a limitation of doctest b
On Wed, 12 Jan 2022 09:28:16 +1100,
Cameron Simpson wrote:
[...]
> Personally I'd be inclined to put long identical examples in the class
> docstring instead of the method, but that may not be appropriate.
Good point, and perhaps it's best to put a comprehensive example in the
class docstring,
On 11Jan2022 16:09, Sebastian Luque wrote:
>I am searching for a mechanism for sharing data across Examples
>sections
>in docstrings within a class. For instance:
>
>class Foo:
>
>def foo(self):
>"""Method foo title
>
>The example generating data below may be much more labori
On Wed, Jan 12, 2022 at 9:11 AM Sebastian Luque wrote:
>
> Hello,
>
> I am searching for a mechanism for sharing data across Examples sections
> in docstrings within a class. For instance:
This seems like trying to cram too much information into the
docstring, but oh well... do what you will.
I
Hello,
I am searching for a mechanism for sharing data across Examples sections
in docstrings within a class. For instance:
class Foo:
def foo(self):
"""Method foo title
The example generating data below may be much more laborious.
Examples