I recently dived into Python Blender scripting, while reading the Blender API some Python script got me stuck, I couldn't understand it, I can make it work though, here is the code from Blender API,
# Create new object with our light datablock.
light_object = bpy.data.objects.new(name="New Light", object_data=light_data)
The line bpy.data.objects.new(), Why 'data' can be chained after bpy? I'm sure 'bpy' is the module name, is '.data' and '.object' a method returning 'self' or is it a class name?
The menu said the 'bpy.data' is type of 'bpy.types.BlendData', I can not wrap my head around for this Python syntax, can you shed some light on what type of each section of the code really is so I can use the right term to search the syntax