You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function with regex in docstring explaining how the input argument should look like:
deffun(data: str) ->str:
"""Does something. Args: data: A string metadata (regex: ^[YN]\d\d [YN]\d\d$). Returns: A string something. """return'Something'
Triggers:
************* Module xyz
xyz.py:794:43: W1401: Anomalous backslash in string: '\d'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
Shouldn't it be OK to include whatever in the docstring?
P.S. I've tried marking the entire regex as r'regex' but it still triggered the warning...
Documentation for future user
I don't really know, the available flags do not seem to address this one.
Additional context
Linux ip-172-31-31-219 5.19.0-1020-aws #21-Ubuntu SMP Thu Feb 9 17:37:58 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Question
I have a function with regex in docstring explaining how the input argument should look like:
Triggers:
************* Module xyz
xyz.py:794:43: W1401: Anomalous backslash in string: '\d'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
Shouldn't it be OK to include whatever in the docstring?
P.S. I've tried marking the entire regex as r'regex' but it still triggered the warning...
Documentation for future user
I don't really know, the available flags do not seem to address this one.
Additional context
Linux ip-172-31-31-219 5.19.0-1020-aws #21-Ubuntu SMP Thu Feb 9 17:37:58 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Name: pylint
Version: 2.17.0
Summary: python code static checker
Home-page:
Author:
Author-email: Python Code Quality Authority [email protected]
License: GPL-2.0-or-later
Location: /home/ubuntu/.local/lib/python3.10/site-packages
Requires: astroid, dill, isort, mccabe, platformdirs, tomli, tomlkit
Required-by:
Python 3.10.7
The text was updated successfully, but these errors were encountered: