problem with a Python array inside a PropertyGroup

I’m storing some data in a Python array (because CollectinProperty is too slow when I have a lot of data) which is stored inside a PropertyGroup attached to scene, like so:


class ToolkitProps(PropertyGroup) :
    
    AtomList = []

    # Lots of other properties

def register() :
    bpy.utils.register_module(__name__)
    bpy.types.Scene.toolkit_props = PointerProperty(type = ToolkitProps)

The UI is a toolbar. When I click one of the toggle buttons on the toolbar (which is layout.prop for one of the properties inside the same PropertyGroup, ToolkitProps), that triggers an update function that populates AtomList by assigning some array to self.AtomList. But there’s a problem! Say I have this code at the end of that function:


print(self)
print(context.scene.toolkit_props)
print("done loading", len(context.scene.toolkit_props.AtomList), len(self.AtomList))

The output is:


<bpy_struct, ToolkitProps("")>
<bpy_struct, ToolkitProps("")>
done loading 0 11

I’m confused. I only have one scene. Does self refer to the same thing as context.scene.toolkit_props or not? If yes, then how come the different references give me different AtomLists? I know I can just always refer to the AtomList as context.scene.tookit_props.AtomList, but it’s hefty, and I’m more interested in why this doesn’t work.

looks like an improper use of propertygroup to me, it is supposed to contain bpy.props properties.

If you want to store a list for a scene, couldn’t you use ID properties?

bpy.context.scene[‘atomlist’] = […] # note: only basic types!

Or the monkey-patching way?
bpy.types.Scene.atomlist = []

I can’t use ID properties because the objects in the array are a custom Python class. The second way should work, but - what’s the difference between using that and the way I have it now (except using context.scene.toolkit_props instead of self every time), what makes this way better? I’m asking from the perspective of best practices, because I want to understand what’s going on better, in case it has bearing on anything else that I’m doing so I don’t run into problems later that I’d have to go back and fix. Thank you.