docpicture
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Tue Oct 14 09:58:10 EDT 2008
On Tue, 14 Oct 2008 06:12:59 -0700, Scott David Daniels wrote:
> Steven D'Aprano wrote:
>> And if not, it's no big deal. Your help string has a clearly labeled
>> few lines of hex:
>>
>> Help on function spam:
>>
>> spam(...)
>> spam spam spam spam spam spam
>> spam spam spam spam with a fried egg on top
>>
>> === begin docpicture ===
>> 1234567890ABCDEF...
>> === end docpicture ===
>> Or similar. I'm sure people will cope, especially since it should be
>> relatively rare.
>>
> or you could even use:
> '''<docpicture name="fig1.png" code="base64" version="1">
> 1234567890ABCDEF...
> </docpicture>'''
> A comment _not_ a docstring (only found by scanning the source). which
> is easy enough to hunt for.
+1 for docpictures
-1 for them being comments instead of docstrings. The whole point of
having them is to allow Python tools to operate on them. I should be able
to do this:
>>> import docpicture
>>> docpicture.gui(myfunction)
and get a nice Tk window showing the picture. There's all sorts of
functionality that you lose by making them comments and therefore
unavailable to Python tools. (Okay, technically this hypothetical
docpicture module could scan the source file -- assuming the source code
is even available, which isn't always true.)
But anyway, we're getting well ahead of ourselves here. Unless bearophile
is willing to share his code, or somebody reverse engineers it, this is
nothing more than vapourware.
--
Steven
More information about the Python-list
mailing list