Skip to main content

strictclasses

Disclaimer: this is beta software, API is not stable.

This is a validation companion to dataclasses.

It adds the strict method to the dataclass to validate the types are correct. Usage:

from dataclasses import dataclass
from strictclasses import strict

@strict
@dataclass
class Foo:
    bar: int


f = Foo('3')
f.strict() # -> AssertionError: bar is not an instance of <class 'int'>

Download files

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

Source Distribution

strictclasses-0.1.4.tar.gz (1.5 kB view details)

Uploaded Source

File details

Details for the file strictclasses-0.1.4.tar.gz.

File metadata

  • Download URL: strictclasses-0.1.4.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for strictclasses-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bfe0016c890d17401419abdf25e6824ee9a2be09ceddb924fe31d863caa7b775
MD5 42bca0af38847a7ed022ac2e383e078d
BLAKE2b-256 ed6b23378c49e5256b543bab14ac14eecbcb62e670822bb7cadc2d2174a741ea

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 file

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page