how to call `getattr()` to get a Python MySQLCursor method?
Question: What do I need to do do before, to make this Python call succeed:

    
    
    >>>getattr(MySQLCursor, "fetchall")
    

If I just make this call at the beginning of a script, it fails. I have a
cursor and I need to programmatically obtain one of it's methods, such as
`fetchall()` from the string, such as `"fetchall"` I don't understand how to
setup this call so it succeeds.


Answer: `getattr(MySQLCursor, "fetchall")` does work:

    
    
    >>> from mysql.connector.cursor import MySQLCursor
    >>> getattr(MySQLCursor, 'fetchall')
    <unbound method MySQLCursor.fetchall>
    

So there it is, an unbound method within the _class_ MySQLCursor.

If you have an _instance_ of the cursor, then you can get a bound method,
which you can call:

    
    
    >>> from mysql.connector.cursor import MySQLCursor
    >>> cursor = MySQLCursor()
    >>> cursor
    <mysql.connector.cursor.MySQLCursor object at 0x7f9368a86350>
    >>> getattr(cursor, 'fetchall')
    <bound method MySQLCursor.fetchall of <mysql.connector.cursor.MySQLCursor object at 0x7f9368a86350>>
    >>> getattr(cursor, 'fetchall')()
    

