comparative
Implement comparison magic methods in one line!
Usage
from comparative import compare_by
@compare_by("hour", "minute", "second")
class Clock:
def __int__(self, hour=0, minute=0, second=0):
self.hour = hour
self.minute = mintue
self.second = second
def __repr__(self):
return ("Clock(h={0.hour:}, m={0.minute:02d}, "
"s={0.second:02d})").format(self)
def __str__(self):
return "{0.hour:02d}:{0.minute:02d}:{0.second:02d}".format(self)
Just Add Water
>>> clock1 = Clock(8, 0, 0)
>>> clock2 = Clock(8, 0, 1)
>>> clock3 = Clock(8, 0, 0)
>>> clock1 < clock2
True
>>> clock1 == clock2
False
>>> clock1 == clock3
True
t@o55bhDr%
Metadata
Release files for comparative 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| comparative-0.0.2.tar.gz | 1.9 kB | Without provenance | Details for comparative-0.0.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| comparative-0.0.2-py3.7.egg | Legacy Egg format | - | - | Details for comparative-0.0.2-py3.7.egg |
| comparative-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for comparative-0.0.2-py3-none-any.whl |
Total release size: 19.9 kB
Release files / comparative-0.0.2.tar.gz
| Download URL | comparative-0.0.2.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9a6531170d90b7474eb3d6972367ac4e9c308b793bacdc8642c276eda41302d
|
|
BLAKE2b-256 checksum How to use checksums |
923755b8ca5b436536ff74506a87ab7a219e2289f9935e307382cdcc1e124918
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / comparative-0.0.2-py3.7.egg
| Download URL | comparative-0.0.2-py3.7.egg |
|---|---|
| Size | 3.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
575a87014d917349b5116ae99ae3e1e709d7ed8a1eb38c59e476f778cc22e3ce
|
|
BLAKE2b-256 checksum How to use checksums |
e1b2beaee3992b8a2a031b3ca63ae44b6f997d86807b7770d11ca79f7d9cb719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / comparative-0.0.2-py3-none-any.whl
| Download URL | comparative-0.0.2-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99781716210ccf8a0bfddde066ff0166bc2647ec116c58e5cda3282d88396f1b
|
|
BLAKE2b-256 checksum How to use checksums |
a6704a1161e98a3c2e38c0dd7edf33b15db2005c2d454eeb79e68b2231e133eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for comparative 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.