Skip to main content

Stubs with type annotations for ordered-set Python library

Project description

ordered-set-stubs - stubs with type annotations for ordered-set Python library

Usage

For example, you have the following code in ordered_set_stubs_test.py file:

from ordered_set import OrderedSet


# noinspection PyPep8Naming
def receives_OrderedSet_int(ordered_set: 'OrderedSet[int]') -> 'OrderedSet[int]':
    return ordered_set


receives_OrderedSet_int(OrderedSet(['ololo']))

Run mypy to check the code and check that it returns an error:

$ mypy ordered_set_stubs_test.py
ordered_set_stubs_test.py:10: error: List item 0 has incompatible type "str"; expected "int"

In Python 3.7 you can even drop quotes:

from __future__ import annotations
from ordered_set import OrderedSet


# noinspection PyPep8Naming
def receives_OrderedSet_int(ordered_set: OrderedSet[int]) -> OrderedSet[int]:
    return ordered_set


receives_OrderedSet_int(OrderedSet(['ololo']))

Project details


Download files

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

Files for ordered-set-stubs, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size ordered_set_stubs-0.1.3-py2.py3-none-any.whl (4.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size ordered_set-stubs-0.1.3.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page