Skip to main content

Check if an object is an `Annotated` type.

Project description

is_annotated

Check if an object is an Annotated type.

This is a micro-package, containing the single function isannotated to check if a type hint is an Annotated type. Annotated objects can't be checked by normal isinstance checks.

Installation

PyPI platforms PyPI version

pip install is_annotated

Documentation

Actions Status

from typing import Annotated
from is_annotated import isannotated

print(isannotated(1))
# False

print(isannotated(int))
# False

print(isannotated(Annotated[int, "1"]))
# True

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

is_annotated-1.0.1.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

is_annotated-1.0.1-py3-none-any.whl (4.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