简体   繁体   中英

Auto-completion & documentation of Python code

Can I use index.d.ts to enable custom code documentation & auto-completion for Python code as we do in JS? if so, how? If not, is there any equivalent for Python?

Yes, there have been various additions to Python over time that allow you to do so.

As mentioned in the comments, https://www.python.org/dev/peps/pep-0526/ and https://www.python.org/dev/peps/pep-0257/ cover this in part.

See also the documentation on type hints here https://docs.python.org/3/library/typing.html

Note that if you wanted to know how to provide type hints for a very specific example, you should have probably included some sample code that needed the hints, but hopefully the above helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM