[SciPy-dev] ndimage - docfiller and output_type
Ralf Gommers
ralf.gommers at googlemail.com
Wed Oct 28 10:41:33 EDT 2009
Thanks for the feedback Josef.
On Wed, Oct 28, 2009 at 2:52 PM, <josef.pktd at gmail.com> wrote:
> Just some quick comments (I will look more after Friday)
>
>
I don't see a big break with the current system, but the templating
> system looks cleaner.
>
Well I did not want to be too radical, just make it a bit more flexible and
better-looking:)
>
> One difference: standard help doesn't get the substitution in the docstring
> >>> help(maxwell)
> >>> maxwell.__doc__
> >>> help(stats.distributions.norm)
>
>
> no difference in the docstring of the class:
> >>> print stats.distributions.norm_gen.__doc__
> None
> >>> print distname_gen.__doc__
> None
> >>> print maxwell_gen.__doc__
> ...
>
> Is it possible to attach the docstring to the distribution (sub) class
> when it is instantiated, e.g.
>
> self.__class__.__doc__ = generated docs # I didn't try this
>
That works, good point. Fixes the python help() as well.
>
> (The current dist_gen classes are missing a __init__, so the class
> doesn't get any of the information.)
>
> So, I think overall it looks pretty good.
> Does it really make the life for the doceditor easier?
>
It should do in the future, but right now that is just an added benefit.
More important is that you just get better docstrings.
> The template substitution is still in the rvclass.__init__
>
This can disappear once all classes have their own docstring. I was being
conservative by keeping the old system as a backup.
If you would be happy if I gave each `_gen` class a default docstring based
on the new system, and completely remove the templates in
rv_continuous/rv_discrete, I will do that.
Cheers,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20091028/06b8d4de/attachment.html>
More information about the SciPy-Dev
mailing list