Hide Blender's grid floor programmatically
To show or hide the grid floor you must first find the 3D view space, then use the space's show_floor porperty:

import bpy

def find_3dview_space():
    # Find 3D_View window and its scren space
    area = None
    for a in bpy.data.window_managers[0].windows[0].screen.areas:
        if a.type == 'VIEW_3D':
            area = a
            break

    if area:
        space = area.spaces[0]
    else:
        space = bpy.context.space_data

    return space

space = find_3dview_space()
space.show_floor = False


What you tried to do is to access the SpaceView3D type, which is the class of the 3D view space object. You cannot access methods directly from the class, but rather need to find the object instantiating that class as specified above.