python mysql api apostrophe
===

It's known that Python's cgi.escape() function does not escape quotes or the apostrophe.  Can the same be said for the Python MySQLdb API?
In the case below is the apostrophe in O'Reilly escaped on entering the database?

    lastname = O'Reilly
    cursor.execute ('INSERT INTO table_name (surname) VALUES (%s)', (lastname,))

Thanks!