Dear friends!!! Please like the video and leave a comment. It helps with the visibility of my channel on RUclips. If you are interested in reading, you can always check out my latest articles on pythonology.eu Thanks a lot!
This is great to know! Very interesting to learn about PyDoc and how we can automatically generate documentation! This could also in theory be used for github docs. I wonder if that could be an easy step. Then we could in theory host the generated static html code directly into it and keep the repo updated! I will try that. Thanks for the great video! 👍
Hi there once again. I will definitely use this module for my new chat sentiment analyser project. Thanks a tonn. I came looking for copper but instead I found gold.....
I use a wrapper in my script to start several functions in a new thread using a decorator. When I tried out Pydoc, I found that the documentation only specified the wrapper's docstring for each of these functions. Unfortunately, the docstrings of the actual functions were ignored. def thread_it(func): """ A wrapper to start functions in a new thread using a decorator. Parameters ---------- func : function the function to start in a new thread """ def func_wrapper(): """ func_wrapper starts the function "func" in a new thread. """ _thread.start_new_thread(func, ()) return func_wrapper @thread_it def weather_info() -> None: """ Get weather informations using the *****-API """ while True: try: ... The output from Pydoc: weather_info = func_wrapper() func_wrapper starts the function "func" in a new thread.
OK, learned something about PyDoc today because of your question. Since inner/nested functions are not directly accessible from outside their enclosing function, PyDoc cannot generate documentation for them. However, if you want to generate documentation for the inner function, you can make it a standalone function or a method of a class.
Dear friends!!! Please like the video and leave a comment. It helps with the visibility of my channel on RUclips. If you are interested in reading, you can always check out my latest articles on pythonology.eu Thanks a lot!
This is great to know! Very interesting to learn about PyDoc and how we can automatically generate documentation! This could also in theory be used for github docs. I wonder if that could be an easy step. Then we could in theory host the generated static html code directly into it and keep the repo updated! I will try that. Thanks for the great video! 👍
That sounds like a very good idea!
Hi there once again.
I will definitely use this module for my new chat sentiment analyser project.
Thanks a tonn.
I came looking for copper but instead I found gold.....
Irfan thank you so much for your kind words and comment. Glad I helped 🙂
I use a wrapper in my script to start several functions in a new thread using a decorator. When I tried out Pydoc, I found that the documentation only specified the wrapper's docstring for each of these functions. Unfortunately, the docstrings of the actual functions were ignored.
def thread_it(func):
"""
A wrapper to start functions in a new thread using a decorator.
Parameters
----------
func : function
the function to start in a new thread
"""
def func_wrapper():
"""
func_wrapper starts the function "func" in a new thread.
"""
_thread.start_new_thread(func, ())
return func_wrapper
@thread_it
def weather_info() -> None:
"""
Get weather informations using the *****-API
"""
while True:
try:
...
The output from Pydoc:
weather_info = func_wrapper()
func_wrapper starts the function "func" in a new thread.
OK, learned something about PyDoc today because of your question. Since inner/nested functions are not directly accessible from outside their enclosing function, PyDoc cannot generate documentation for them. However, if you want to generate documentation for the inner function, you can make it a standalone function or a method of a class.
this could be a better reply :D
@@Pythonology Ah OK thanks. So we both learned something. Cool too 🙂
Martin Shirley Perez Gary Williams Ronald
🤭 'Promo sm'