why grid lines + scale doesn't update, when controlled via python console?
Difference between a class and an instance.

bpy.types.SpaceView3D is a class, it has a grid_lines property. The blender UI has a window, made up of screens, made up of areas, within each area an active space (what you see in that area). The active space in a view 3d area is an instance of the bpy.types.SpaceView3D class.

Running this code in the text editor will change all 3d view spaces grid lines to 10 and scale to 2

import bpy

for screen in bpy.data.screens:
    for area in screen.areas:
        if area.type == 'VIEW_3D':
            area.spaces.active.grid_lines = 10
            area.spaces.active.grid_scale = 2


in the python console the active space is not a 3d view area, rather a python console.  Similar to above but in console

&gt;&gt;&gt; type(C.space_data)
&lt;class 'bpy.types.SpaceConsole'&gt;

&gt;&gt;&gt; for i, a in enumerate(C.screen.areas):
...     i, a.type
...     
(0, 'INFO')
(1, 'PROPERTIES')
(2, 'CONSOLE')
(3, 'VIEW_3D')
(4, 'TEXT_EDITOR')

&gt;&gt;&gt; space3d = C.screen.areas[3].spaces.active
&gt;&gt;&gt; type(space3d)
&lt;class 'bpy.types.SpaceView3D'&gt;

&gt;&gt;&gt; space3d.grid_lines = 10


If the code is invoked, via a button or menu (for example),  in the context of the 3d view, then the 3D VIEW space would also be context.space_data