How to use the dataclasses._process_class function in dataclasses

To help you get started, we’ve selected a few dataclasses examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Roboy / sonosco / sonosco / serialization / serialization.py View on Github external
def wrap(cls):
        cls = _process_class(cls, init=True, repr=False, eq=False, order=False, unsafe_hash=False, frozen=False)
        _set_new_attribute(cls, '__serialize__', __add_serialize(cls, model, enforced_serializable, skip_fields))
        return cls
github seequent / pure_interface / pure_interface.py View on Github external
def wrap(cls):
            # dataclasses only operates on annotations in the current class
            # get all interface attributes and add them to this class
            interface_annos = _get_interface_annotions(cls)
            annos = cls.__dict__.get('__annotations__', {})
            interface_annos.update(annos)
            cls.__annotations__ = interface_annos
            return dataclasses._process_class(cls, init, repr, eq, order, unsafe_hash, frozen)