William Stein wrote:
> On Wed, 13 Dec 2006 12:09:25 -0800, Nick Alexander <[EMAIL PROTECTED]>
> wrote:
> >> I am against enhancing the docstrings as you suggest. I think we should
> >> write code to parse the original .pyx files, given the filename and line
> >> number information.  There is no extra overhead spacewise, and this fits
> >> with how the rest of Python works better.  Also, it is what I already
> >> planned to do, but hadn't got to yet  All I did was put something for
> >> parsing out the source code -- try ?? on a sagex function.
> >
> > Okay, this sounds like a good task for me.
>
> I'd be very happy if you were to do this.  Thanks!
>
> >  I personally am not
> > comfortable with ad-hoc parsing, so I avoid it like the plague, but
> > I'll take a look at inspect and see what the 'officially sanctioned'
> > technique is.
>
> Keep in mind that as languages go, Python is very easy to parse.
> E.g., if f is a function definition:
>
> def f(x):
>     blah
>
> It's really easy to know where the definition ends.

Parsers have this funny way of bit-rotting over time... I'll write
tests :)

BTW, inspect.py does not parse source code.  All the information is
stored at compile time (as you would expect -- the syntax tree is still
live) and inspect.py just provides a nicer interface to query the
stored information.

Nick


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to