Add python stub file for type annotation hint on developing. #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
最近也是恰好需要用到python的nacos sdk,官方的v2维护不够活跃,恰好发现了这个宝藏库🤩,十分感谢作者的贡献。但是在使用过程中,比较盲盒。遂 #5 开启了这个issue,希望添加
type hints
辅助。目前我已经参照 python-typing-hints 的建议在项目根目录增加了一个
nacos_sdk_rust_binding_py.pyi
文件,自测可以随着maturin develop
在本地环境安装的时候会看到比原本多了一个
__init__.pyi
文件,下面是执行了maturin develop
后的安装包目录结构:然后这是在IDE使用的时候,提示的内容:
此文件仅用于类型的声明,当使用mypy的时候可以为 Python 代码提供静态类型检查,以及优化开发体验。
希望 @CherishCai 可以再次验证,并希望能使得该功能让项目体验更加完美。🙏