O
O
Oleg Pravdin2017-11-01 12:58:19
Python
Oleg Pravdin, 2017-11-01 12:58:19

How to build a data model for Python syntax highlighting?

Hello. There is some code that makes a request to the server, receives a JSON response, and deserializes it into a dictionary. The structure of the dictionary is known in advance and does not change (say, the errorCode return code and the dataStr string). How to make a "model" of the returned data so that you can see hints when writing code (auto-completion to response.errorCode and response.dataStr respectively, hints for int and str methods)? VS:Code environment, Python 3.6.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Avrong, 2017-11-01
@Avrong

You will need Python Docstrings.
Documenting code in Python. PEP 257
PEP 257 -- Docstring Conventions
Example: pallets/flask/flask/app.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question