Define If
If the condition is true, define the method.
For more information see: https://defineif.hakancelik.dev/
How to install ?
pip install defineif
How to use it ?
import os
from defineif import DefineIf
class Klass(DefineIf):
@staticmethod
@DefineIf(os.name == 'nt')
def get_platform():
return 'Windows'
@staticmethod
@DefineIf(os.name == 'posix')
def get_platform():
return 'Linux'
platform = Klass.get_platform()
print(platform)
Release files for defineif 0.1.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 | |
|---|---|---|---|
| defineif-0.1.0.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| defineif-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.0 kB
Release files / defineif-0.1.0.tar.gz
| Download URL | defineif-0.1.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
355849550c5c06c2fdd24c584de4050109efd048638edb66d8c35072d6d92027
|
|
BLAKE2b-256 checksum How to use checksums |
2b650f8a467d4639d021caeb2a7513fc2d71685f815d853ff0b20b8fdd0b67f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / defineif-0.1.0-py3-none-any.whl
| Download URL | defineif-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dadc7fc3fefe01f17c5ed66668a8e7d92fdd5f4994e2dbdb09a314e5b8a84676
|
|
BLAKE2b-256 checksum How to use checksums |
eb2a618043243c8f6198e198f436d6f585cae70bdb9bba7474fafa054af786bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|