Skip to main content

A slightly improved dataclasses

Project description

  • dataclass: like dataclasses.dataclass, except:
    • Adds three new instance methods to each dataclass
      • asdict(), astuple(), replace()

    • …and one new class method,
      • fields()

    • frozen=True is now the default!

    • xmod -ed for less cruft

  • dataclass.field: Like dataclasses.field, except:
    • default_factory is now a positional parameter

    • perfectly backward compatible

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataclas-0.9.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

dataclas-0.9.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page