hazelcast / hazelcast/hazelcast-python-client
[Developer Experience] Add typing support
- Dominant language
- Python
- Stars
- 116
- Forks
- 78
- Avg merge
- 10d 22h
- Merged PRs (30d)
- 1
Description
Typing support improves editor intellisense and also the correctness of the code. We won't be able to support Python 3.5+'s typing syntax until we drop support for Python < 3.5, but we can still use [mypy](https://mypy.readthedocs.io/en/stable/) to add typing for older Python 3 versions and Python 2.7.
Here's an example Python 2.7/3 code which annotates the `value` parameter as a string. Both PyCharm and VS Code recognize the typing and recognize `value` is a string without any settings or third party extensions.
```python
class C:
def __init__(self, value):
# type: (str) -> None
self.value = value
```
See also: https://github.com/hazelcast/hazelcast-python-client/issues/356
Contributor guide
Assessment
This issue has not been assessed yet.