Blender 2.8x Save Add-on Class Instance To Scene
This is what is often referred to as a monkey patch.  Data will not be saved to blend file.
To monkey patch onto a scene type could simply
import bpy

class HoldData: 
    dat = None       

def register():
    bpy.types.Scene.my_data = HoldData()

def unregister():
    del bpy.types.Scene.my_data
    
if __name__ == &quot;__main__&quot;:
    register()

Test in console
&gt;&gt;&gt; C.scene.my_data.dat = &quot;foo&quot;
&gt;&gt;&gt; C.scene.my_data.dat
'foo'

In as much as can do this, would favour simply
from foo import HoldData

my_data = HoldData()

and
from bah import my_data

To save some data to blender and use a third party for other recommend a PropertyGroup and PointerProperty set up.   Not all members of the defined property group need be annotated properties.
The other issue mentioned is a typo, the class is bpy.types.AnyType (CamelCase ie capital T for type)  Not sure where you're going with this either?