Skip to main content

DataClassCopyMixin

DataClassCopyMixin

  • Description

    Provides a cloning method for DataClass objects, allowing the duplication of DataClass objects.

  • Example

    from dataclasses import dataclass
    from docsaidkit import DataclassCopyMixin

    @dataclass
    class Person(DataclassCopyMixin):
    name: str
    age: int

    person = Person('Alice', 20)
    person_copy = person.__copy__()
    person_deepcopy = person.__deepcopy__()