hazelcast-python-client icon indicating copy to clipboard operation
hazelcast-python-client copied to clipboard

[Developer Experience] Add typing support

Open yuce opened this issue 4 years ago • 0 comments

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 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.

class C:
    def __init__(self, value):
        # type: (str) -> None
        self.value = value

See also: https://github.com/hazelcast/hazelcast-python-client/issues/356

yuce avatar Feb 07 '21 15:02 yuce