attr: defineif.__description__
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
defineif-0.1.0.tar.gz
(18.0 kB
view hashes)
Built Distribution
defineif-0.1.0-py3-none-any.whl
(16.0 kB
view hashes)