Re: [myhdl-list] Another typo in docs
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-01-06 20:44:59
|
On 06/01/15 20:31, Ben wrote: >>> I had to replicate some code in the documentation for doctest to work >>> >>(which just makes it easier to copy and paste, though potentially open >>> >>to replication errors down the line). The issue seemed to be related to >>> >>globals in the doctest string, though I've not tried to hard to get to >>> >>the bottom of it. >>> >> >> > >> >I did not find a work around for this. Your approach is nice >> >to enable doctest but I am worried the maintenance will be a >> >pain (double code snips). > Maybe there is a way using the ``doctest_global_setup`` config value > [0]. The conf.py file is python so it should be possible to read (part > of) another python file to populate that variable. That code would be > automatically 'duplicated' on top of each file ... I did wonder if there was some trick that could be done with defining functions elsewhere. I can't see how this solves it though. Is there some way in which a global (or perhaps a hidden local) can be used to make sure the displayed code is correct? I don't see how we get round the problem that a carried forward instance factory seems to get broken by doctest. Henry |