Python自動化測試(1) : json到thrift轉換

從thrift到pyi轉換

pyi是什麼?爲什麼要用pyi?可見官方解釋

The *.pyi files are used by PyCharm and other development tools to
provide more information, such as PEP 484 type hints, than it is able
to glean from introspection of extension types and methods. They are
not intended to be imported, executed or used for any other purpose
other than providing info to the tools. If you don’t use use a tool
that makes use of .pyi files then you can safely ignore this file.

See: https://www.python.org/dev/peps/pep-0484/
https://www.jetbrains.com/help/pycharm/2016.1/type-hinting-in-pycharm.html

簡單來說就是存根文件,文件包含普通Python模塊的類型提示信息,可以幫我們增加thrift的類型提示。爲了方便使用,將thrift轉換爲pyi的方式,方便class的查找,具體使用方式:

 pip ins
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章