Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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


Release history Release notifications

This version

0.1.3

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 hashes
Filename, size ordered_set-stubs-0.1.3.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View hashes

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page