hakancelikdev / defineif

:trollface: If the condition is true, define the method. [ Just for fun ]

Home Page:https://defineif.hakancelik.dev

Repository from Github https://github.comhakancelikdev/defineifRepository from Github https://github.comhakancelikdev/defineif

Define If

If the condition is true, define the method.

pre-commit.ci status test build-docs publish-package-on-pypi

Pypi PyPI - Python Version Downloads License

Forks Issues Stars

Codecov Contributors Last Commit

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)

About

:trollface: If the condition is true, define the method. [ Just for fun ]

https://defineif.hakancelik.dev

License:GNU General Public License v3.0


Languages

Language:Python 82.1%Language:Makefile 15.6%Language:Dockerfile 2.3%