About
Abstract base class for python value objects.
Usage
Extend and implement the is_valid method.
class Weight(ValueObject):
def is_valid(self, value: int) -> bool:
return isinstance(value, int) and value >= 0
Equality example:
o = Weight(10)
p = Weight(11)
q = Weight(11)
print('o ', o)
print('p ', p)
print('q ', q)
print('o == p ', o == p)
print('o == q ', o == q)
print('p == q ', p == q)
Release files for pythonvalueobject 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pythonvalueobject-1.0.0.tar.gz | 2.8 kB | Details |
Release files / pythonvalueobject-1.0.0.tar.gz
| Download URL | pythonvalueobject-1.0.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c081324f2850e2cb4a0c26a41fe55e39a145b8b955237d982f29727c964b201
|
|
BLAKE2b-256 checksum How to use checksums |
31a24eebf14d5744b7d5cf0d59a9ffcff00628dcd81f71e3aa17c85b55a9a167
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|