Does python have an internal list/dictionary of functions?

Discussion in 'Python' started by Carl J. Van Arsdall, Feb 16, 2006.

  1. Python Gurus:

    Let me elaborate a bit more on this question. Basically, I want to know
    if there is some data structure in python that maps a string function
    name to an address of a function or something to that nature.

    If this is confusing, let me describe what I want to do and see if
    anyone has any ideas.

    basically we have:

    >>>def functA():

    .... pass

    >>> functA

    <function functA at 80db128>

    And what I'd like to do is:

    >>>__internalFuncDict__['functA']

    <function functA at 80db128>

    This is just for a little experimental project of mine, any help or
    pointers to the proper pages in the manual would be greatly
    appreciated. Basically, I know that I can create something like this if
    I have to but I was very much hoping that something already existed
    somewhere that I could get to via python or by writing a C extension.

    Thanks in advance!

    -carl


    --

    Carl J. Van Arsdall

    Build and Release
    MontaVista Software
     
    Carl J. Van Arsdall, Feb 16, 2006
    #1
    1. Advertisements

  2. [Carl J. Van Arsdall]
    > basically we have:
    >
    > >>>def functA():

    > ... pass
    >
    > >>> functA

    > <function functA at 80db128>
    >
    > And what I'd like to do is:
    >
    > >>>__internalFuncDict__['functA']

    > <function functA at 80db128>


    globals()['functA']
     
    Raymond Hettinger, Feb 16, 2006
    #2
    1. Advertisements

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. Xiangliang Meng
    Replies:
    1
    Views:
    1,923
    Victor Bazarov
    Jun 21, 2004
  2. Daniel Vallstrom
    Replies:
    2
    Views:
    2,900
    Kevin Bracey
    Nov 21, 2003
  3. Replies:
    8
    Views:
    406
    Tim Williams (gmail)
    Nov 2, 2005
  4. Carl J. Van Arsdall
    Replies:
    4
    Views:
    550
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=
    Feb 18, 2006
  5. wardm
    Replies:
    7
    Views:
    483
    Alex Martelli
    Aug 13, 2006
  6. dackz
    Replies:
    0
    Views:
    611
    dackz
    Feb 6, 2007
  7. rupert
    Replies:
    8
    Views:
    768
    Jerry Coffin
    Jul 28, 2006
  8. py
    Replies:
    5
    Views:
    535
    Daniel DeLorme
    Mar 24, 2007
Loading...