It seems like you're wanting to make a general pattern where the
results of a function get stored in an array with a doc determined by
that function's docstring. Decorators work well for this sort of
thing.
-Ken



On Fri, Sep 4, 2009 at 3:06 PM, nicky van foreest<vanfore...@gmail.com> wrote:
> Hi,
>
> I realize my question is somewhat off-topic for the pytables
> community, but the problem originates from my using pytables.  In the
> skeleton code below I do not like to use the function's name to get
> the doc string.
>
> def dumFunction():
>    """This function will gain me with the Nobel Prize...in another life."""
>    fp = openFile("res.h5", mode='a')
>    results = []
>    resArray = fp.createArray(fp.root, "Pete", results, dumFunction.__doc__)
>
>
> Now I would rather not pass dumFunction.__doc__ as an argument.
> Instead, I want to use something like the C++ pointer this, that is,
> something like this.__doc__. In other words, how do I get a reference
> to the doc string, without having to use the function's name?
>
> Thanks.
>
> Nicky
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Pytables-users mailing list
> Pytables-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pytables-users
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to