from .xyz import FunctionA also imports FunctionB and FunctionC - confused why I am surprised that besides AlignZ also AlignX is being imported while I specify only to import AlignZ

I was under the impression that with import * you import all functions in the py document instead of specifying each.



Pie Menu py file:

from .pietransformation import AlignZ


transformation py file:

import bpy, os
from bpy.types import Menu, Header   
from bpy.props import IntProperty, FloatProperty, BoolProperty
import bmesh
from mathutils import *
import math

#AlignX
class AlignX(bpy.types.Operator):
    bl_idname = "align.x"
    bl_label = "Align X"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self,context):
        scene = context.scene
        #bpy.context.space_data.pivot_point = 'CURSOR'
        bpy.ops.transform.resize(value=(0, 1, 1), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='ROOT', proportional_size=0.0323492)

        return {'FINISHED'}

# #AlignY
# class AlignY(bpy.types.Operator):
#     bl_idname = "align.y"
#     bl_label = "Align Y"
#     bl_options = {'REGISTER', 'UNDO'}

#     def execute(self,context):
#         scene = context.scene
#         #bpy.context.space_data.pivot_point = 'CURSOR'
#         bpy.ops.transform.resize(value=(1, 0, 1), constraint_axis=(False, True, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='ROOT', proportional_size=0.0323492)

#         return {'FINISHED'}


#AlignZ  
class AlignZ(bpy.types.Operator):
    bl_idname = "align.z"
    bl_label = "Align Z"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self,context):
        scene = context.scene
        #bpy.context.space_data.pivot_point = 'CURSOR'
        bpy.ops.transform.resize(value=(1, 1, 0), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='ROOT', proportional_size=0.0323492)

        return {'FINISHED'}       





def register():
    bpy.utils.register_module(__name__)


def unregister():
    bpy.utils.unregister_module(__name__)
A blender addon is a python module. Using bpy.utils.register_module(__name__) will register every class within the module, which includes classes in all .py files within a module made of multiple files.

Don't confuse importing with blender's registering process. By importing you are bringing the class into the current namespace, which could be a methods namespace, but blender's register causes a suitable class to be registered as an operator under bpy.ops making it available to display in a menu using the layouts operator() method.