Not-quite-the-module-name qualified names in extension modules? What?

Discussion in 'Python' started by Alf P. Steinbach /Usenet, Jul 10, 2010.

  1. Hi.

    I built the [xxmodule.c] from the source distribution, as suggested by the
    Python 3.1.1 docs. I named this [xx.pyd], as I believed the module name was just
    "xx". Indeed importing xx works fine, but when I do help(xx) I get ...


    <example>
    >>> help( xx )

    Help on module xx:

    NAME
    xx - This is a template module just for instruction.

    FILE
    c:\projects\progrock\lib\progrock\cppy_dev\examples\02_xx_apilevel\xx.pyd

    CLASSES
    builtins.Exception(builtins.BaseException)
    error
    builtins.object
    xxmodule.Null
    builtins.str(builtins.object)
    xxmodule.Str

    class Null(builtins.object)
    | Methods defined here:
    |
    </example>


    .... with the name "xxmodule" somehow in there as qualification.

    Checking the standard "csv" module I similarly get ...


    <example>
    CLASSES
    builtins.Exception(builtins.BaseException)
    _csv.Error
    builtins.object
    Dialect
    excel
    excel_tab
    DictReader
    DictWriter
    Sniffer
    </example>


    .... with the name "_csv" in there.

    And I'm pretty sure that these not-quite-the-module-name names stem from the
    literal specification of names in the C code in the extension module, assuming
    that the csv module is indeed a C extension module.

    Is it really necessary to qualify names in the C code?

    And can it do harm when such name qualification is not using the final module
    name but instead something like "xxmodule" or "_csv"?

    More to the point, what's the point?


    Cheers,

    - Alf

    --
    blog at <url: http://alfps.wordpress.com>
     
    Alf P. Steinbach /Usenet, Jul 10, 2010
    #1
    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. S.Marion
    Replies:
    2
    Views:
    513
    Roedy Green
    Mar 3, 2006
  2. Ivan A. Kosarev
    Replies:
    0
    Views:
    374
    Ivan A. Kosarev
    Jan 13, 2006
  3. Wayne Shu
    Replies:
    4
    Views:
    789
  4. George2

    qualified name and unqualified name

    George2, Mar 7, 2008, in forum: C Programming
    Replies:
    0
    Views:
    400
    George2
    Mar 7, 2008
  5. Szabolcs Borsanyi

    Pointer to qualified poitner to qualified object

    Szabolcs Borsanyi, May 30, 2008, in forum: C Programming
    Replies:
    13
    Views:
    591
    Keith Thompson
    Jun 8, 2008
Loading...

Share This Page