Skip to main content

No project description provided

Project description

typeduck

Introduction

A lightweight utility for comparing annotation declarations for their compatibility.

Installation

Requires Python 3.8 or above.

pip install typeduck

Usage

from typing import Union, List
from typeduck import TypeDuck

source = List[str]
target = List[Union[str, int]]

td = TypeDuck(source, target)

td.validate()  # returns a boolean when validation passes
# OR
td.validate(raises=True)  # will raise a TypeError when validation fails

See more examples in the tests.py file.

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

typeduck-0.0.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

typeduck-0.0.2-py3-none-any.whl (3.6 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