python : re-use class name
Same class name is not an issue.
when a register-able class is registered it is added to bpy.types with a name generated from the bl_idname.
eg
class Foo(bpy.types.Operator):
    bl_idname = &quot;object.test&quot;

if succesfully registered will be known to blender as the class
bpy.types.OBJECT_OT_test

or similarly after running question code in text editor (__main__ thread)  The OT stands for &quot;Operator Type&quot;, similarly PT and MT are Panels and Menus respectively.
&gt;&gt;&gt; bpy.types.OBJECT_OT_test
&lt;class '__main__.OBJECT_OT_CustomOp'&gt;

&gt;&gt;&gt; bpy.ops.object.test.idname()
'OBJECT_OT_test'

&gt;&gt;&gt; bpy.ops.object.test.idname_py()
'object.test'

Can also import it as a module from text block, and run the register method. This is, IMO, a better way to test simple addon code in blender as it gives the option to unregister, since the classes are no longer &quot;lost&quot; in the main thread.  Find Link
&gt;&gt;&gt; myaddon = D.texts['Text'].as_module()
&gt;&gt;&gt; myaddon.register()
&gt;&gt;&gt; bpy.types.OBJECT_OT_test
&lt;class 'Text.OBJECT_OT_CustomOp'&gt;

So has now re-registered the operator, this time belonging to the &quot;Text&quot; module.
Having a variable the same name in the scope of its own  module is no issue.  Having another matching bl_idname will overwrite the one registered previously.
Would either stick to naming convention and
class OBJECT_OT_test(...):
    bl_idname = &quot;object.test&quot;

or not at all
class TestOperator(...):
    bl_idname = &quot;object.test&quot;

whereas feel question's OBJECT_OT_CustomOp is some hickly-dy pickle-dy in-between sort or arrangement.