Skip to main content

@accepts decorator to check arguments types

Project description

Install

$ [sudo] pip install accepts

Features

  • support multiple types argument
  • support None argument
  • human readable detailed exception message

Examples

>>> @accepts(int)
def inc(value):
	return value+1

>>> inc(1) # ok
>>> inc(1.5) # exception
TypeError: ....

# multiple types
>>> @accepts((int,float))

# None
>>> @accepts((int,float,type(None)))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
accepts-1.0.4-py2.py3-none-any.whl (3.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jul 4, 2018
accepts-1.0.4.tar.gz (1.7 kB) Copy SHA256 hash SHA256 Source None Jul 4, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page