c/c++ extensions and help()

Discussion in 'Python' started by Lenny G., Jul 28, 2005.

  1. Lenny G.

    Lenny G. Guest

    Is there a way to make a c/c++ extension have a useful method
    signature? Right now, help(myCFunc) shows up like:

    myCFunc(...)
    description of myCFunc

    I'd like to be able to see:

    myCFunc(myArg1, myArg2)
    description of myCFunc


    Is this currently possible?

    Thanks,
    Lenny G.
     
    Lenny G., Jul 28, 2005
    #1
    1. Advertising

  2. Lenny G.

    Robert Kern Guest

    Lenny G. wrote:
    > Is there a way to make a c/c++ extension have a useful method
    > signature? Right now, help(myCFunc) shows up like:
    >
    > myCFunc(...)
    > description of myCFunc
    >
    > I'd like to be able to see:
    >
    > myCFunc(myArg1, myArg2)
    > description of myCFunc
    >
    > Is this currently possible?


    There really isn't a way to let the inspect module know about extension
    function arguments. Just put it in the docstring.

    --
    Robert Kern


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
     
    Robert Kern, Jul 29, 2005
    #2
    1. Advertising

  3. Robert Kern <> writes:

    > Lenny G. wrote:
    >> Is there a way to make a c/c++ extension have a useful method
    >> signature? Right now, help(myCFunc) shows up like:
    >> myCFunc(...)
    >> description of myCFunc
    >> I'd like to be able to see:
    >> myCFunc(myArg1, myArg2)
    >> description of myCFunc
    >> Is this currently possible?

    >
    > There really isn't a way to let the inspect module know about
    > extension function arguments. Just put it in the docstring.
    >


    The next release of boost.python should do this automatically:

    (http://mail.python.org/pipermail/c -sig/2005-July/009243.html)


    >>> help(rational.lcm)


    Help on built-in function lcm:

    lcm(...)
    C++ signature:
    lcm(int, int) -> int

    >>> help(rational.int().numerator)


    Help on method numerator:

    numerator(...) method of boost_rational_ext.int instance
    C++ signature:
    numerator(boost::rational<int> {lvalue}) -> int


    Regards, Phil
     
    Philip Austin, Jul 31, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. thewhizkid

    Help! list all file extensions

    thewhizkid, Nov 19, 2003, in forum: Perl
    Replies:
    1
    Views:
    451
    J├╝rgen Exner
    Nov 19, 2003
  2. Bradley E. Rintoul

    GSP Extensions and WalMart

    Bradley E. Rintoul, Sep 19, 2003, in forum: Java
    Replies:
    0
    Views:
    410
    Bradley E. Rintoul
    Sep 19, 2003
  3. Scott
    Replies:
    7
    Views:
    421
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Feb 17, 2005
  4. Jacob Repp
    Replies:
    1
    Views:
    126
    Jacob Repp
    Feb 21, 2006
  5. innes
    Replies:
    2
    Views:
    114
    innes
    Feb 9, 2010
Loading...

Share This Page