Python Strings

Quinn Dunkan quinn at cruzeiro.ugcs.caltech.edu
Wed Sep 6 20:54:58 CEST 2000


On Wed, 6 Sep 2000 14:16:19 +0200, Alex Martelli <aleaxit at yahoo.com> wrote:
>do.  In Python, you can try/except, catch the resulting
>TypeError, and even, I think, parse the message "not
>enough arguments; expected 1, got 0" to get a hint
>about how many args you should supply (alas, it's

It would be easier to check f.func_code.co_argcount

>harder to find out automatically *WHAT* arguments
>the function wants, with what meaning...:-).

Well, that's what docstrings are for!  So you just need a natural-language
parser to read the docstrings, and then you can just wave your arms around and
say "figure out what I want and do it."  Then you can enjoy your lollipop in
peace.



More information about the Python-list mailing list