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 | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ordered_set_stubs-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f76c7470a4e364feb51fe42c4bcd968c8ff9dab520aff9287b394e14da1d1ee |
|
MD5 | 2aca30af7fa29db82905348f1cdfae6a |
|
BLAKE2b-256 | 10d73d6bd9254eaef544a08697a28ba3b04e2faf20b9557b20840f06db725fb3 |