I'm using the pygame module on VSCode and I ran into the issue where the pygame has not init member. I followed the solutions to this link. I edited the user settings and added
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=pygame",
"--unsafe-load-any-extension=y"
]
to the end of the json file
The pygame problem was resolved. However, when I use import random
. I get this warning:
Missing module docstringpylint(missing-module-docstring)
How do I make it go away? Also, is there a better way to resolve the init problem of pygame?
Thanks!
A python module's docstring documents what the contents of that file are for.
You can solve this error by adding a docstring at the top of the module:
"""
Provides some arithmetic functions
"""
def add(a, b):
"""Add two numbers"""
return a + b
def mult(a, b):
"""Multiply two numbers"""
return a * b
Read more at https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings
I just figured out what docstrings are. They just describe the function or class. It's enclosed in three double quotation marks or single quotation marks. This helped me.
To remove docstring warnings in VSCode, I just added "--disable=C0111"
to "python.linting.pylintArgs": []
, which was in the User's JSON settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With