Skip to main content

attr: defineif.__description__

Project description

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)

Project details


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)

Uploaded Source

Built Distribution

defineif-0.1.0-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page