Pylint is complaining round built-in referenced but what is the alternative?
The answers I've seen thus far are simply to quiet Pylint with regards to built-in functions. There must be some other way to call round()
, perhaps in a standard import library? Is there something potentially wrong about using the built-in function?
My searches for these answers have only come up with dozens of tutorials on using the built-in function.
Usage is anything to with round()
. This triggers the warning:
n = 0.05
n = round(n)
The exact warning only shows up in VS Code, it's:
{
"resource": "/C:/Users/neil.obremski/project/file.py",
"owner": "python",
"code": "round-builtin",
"severity": 4,
"message": "round built-in referenced",
"source": "pylint",
"startLineNumber": 434,
"startColumn": 9,
"endLineNumber": 434,
"endColumn": 9
}
UPDATE: This shows up when --enable=W
is set in the Pylint arguments. It shows up for absolutely any use of the round()
function, including specifying the second argument.
Here's what the Pylint output looks like for pylint file.py --enable=W
:
file.py:435:18: W1633: round built-in referenced (round-builtin)