[IPython-dev] ipipe news

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Mar 2 15:29:14 CST 2006


>>>>> "Walter" == Walter Dörwald <walter at livinglogic.de> writes:
    Walter> How about something like this: import ipipe

    Walter> class iinspect(ipipe.Pipe): def __xiter__(self, mode):
    Walter> fields = ("key", "value") for key in dir(self.input):
    Walter> yield ipipe.Fields( fields, key=key,
    Walter> value=getattr(self.input, key) )

OK, great, that is enough to get me started

    Walter> I don't know where this comes from, are these the
    Walter> docstrings of the properties?

Yes, the docstring has a standard formatting convention, eg

    def set_linewidth(self, w):
        """
        Set the line width in points

        ACCEPTS: float value in points
        """
        self._linewidth = w


The inspector will look for lines starting with ACCEPTS: to generate
the property list.  I can hack your example to do the same.

Thanks for the head start!
JDH




More information about the IPython-dev mailing list