How do I construct an object with temporary inputs with python’s dataclasses?

I have a question about best practices when it comes to python dataclasses. The dataclass structure. Is it OK practice to delete temporary class attributes, or am I better off foregoing the dataclass entirely?

I want to use the attribute IOMap (name suggestions welcome) to represent the flow through a factory, where the inputs have a negative rate and the outputs have a positive rate. However, I know that my users will probably be thinking in terms of inputs and outputs, so I want to give them the option to construct the class that way.

There are two ways to do this. This is the traditional approach:

class Factory(Building):
    def __init__(self,
                *,
                id: str,
                name: str,
                power: int,
                size: int,
                inputs: Dict[Material, float] = None,
                outputs: Dict[Material, float] = None,
                IOMap: Dict[Material, float] = None,
    ):
        super().__init__(id, name, power, size)
        
        if IOMap is not None:
            if inputs is not None or outputs is not None:
                raise ValueError("IOMap cannot be used with inputs or outputs.")
            self.IOMap = IOMap
        else:
            if inputs is None or outputs is None:
                raise ValueError("inputs and outputs must be provided if IOMap is not.")
            self.IOMap = outputs
            for material, rate in inputs.items():
                self.IOMap[material] = self.IOMap.get(material, 0) - rate

And this is the dataclass approach:

@dataclass
class Factory(Building):
    inputs: Optional[Dict[Material, float]] = None
    outputs: Optional[Dict[Material, float]] = None
    IOMap: Optional[Dict[Material, float]] = None

    def __post_init__(self):
        if IOMap is not None:
            if inputs is not None or outputs is not None:
                raise ValueError("IOMap cannot be used with inputs or outputs.")
            self.IOMap = IOMap
        else:
            if inputs is None or outputs is None:
                raise ValueError("inputs and outputs must be provided if IOMap is not.")
            self.IOMap = outputs
            for material, rate in inputs.items():
                self.IOMap[material] = self.IOMap.get(material, 0) - rate
        del self.inputs
        del self.outputs

I like this much better, but deleing them in this way just feels… wrong.
I don’t want inputs and outputs to be class attributes. Since IOMap will be used exclusively for internal processes, I don’t want users thinking that they can use inputs and outputs at all.

I would love to continue to use dataclasses, since Factory is the parent of many children, and it would be amazing not to have to write a monstrous __init__ function for every one.

tldr; Is it worth deleting class attributes to continue to use dataclasses, or is it better to move to a traditional class?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật