Blender Documentation states:
Those of you familiar with other Python API’s may be surprised that
new data-blocks in the bpy API can’t be created by calling the class.
As you stated, that makes
bpy.data.objects.new the only way to create new objects.
For my purposes, I created a new
class which did not inherit from
bpy.type.Object but defined a
self.object property and initialized it with the
new function. I then wrote all the methods I needed and modified
self. object inside them.
I defined one base class, and then one additional class for cameras, lamps and objects:
def __init__(self,name, obj, loc):
self.name = name
self.object = obj
self.object.location = loc
# additional properties
def __init__(self, name, loc):
self.data = bpy.data.camera.new(name)
super(ExtendedObject, self).__init__(name, bpy.data.objects.new(name, self.data), loc)
# classes for lamps and 'normal' objects.
I don't know if this is the best way to do it, but it worked out for me.
Hope that can help you. If not, try to describe me the purpose of your class.