Skip to main content

Simple decorators to raise a TypeError, if paramates type not satisfied

Project description


static_parameters
-------------
Simple decorators to raise a TypeError, if parameters
and it's static type added to the description __doc__
as such (parameter_name: str) not satisfied.

Example:
from static_parameters import (
function_parameters,
class_parameters
)

@function_parameters
def example(a, b):
'''Some example to demo ((a: str)) ((b: str))'''
return a + b

# For all methods in a class

@class_parameters(function_parameters)
class Example:
def exm1(a, b):
''' ((a: bool)), ((b: int))

def exm2():
...

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

static_parameters-0.3.tar.gz (2.7 kB view hashes)

Uploaded Source

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