I have two different classes with same Subclass name and printing it out using type() gives me same output.
from enum import IntEnum class Car: class Manufacturer(IntEnum): BMW = 0 AUDI = 1 class Plane: class Manufacturer(IntEnum): AIRBUS = 0 BOEING = 1 print(type(Car.Manufacturer.BMW)) print(type(Plane.Manufacturer.AIRBUS)) Output for both is:
<enum 'Manufacturer'> <enum 'Manufacturer'> Although it does know about the type what it needs to know and makes comparisons appropriately
print(type(Car.Manufacturer.BMW) == type(Plane.Manufacturer.AIRBUS)) # is false as it should be
ManufacturertoCarManufacturerandPlaneManufacturer, respectively.__qualname__attribute of the enum (since it is still a nested class and has all the usual attributes of generic classes). Please see the linked duplicate for details.