New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix syntax warning over comparison of literals using is. #178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The same problem. Please merge this PR :) |
@@ -107,7 +107,7 @@ class _ConnectionDeadError(Exception): | |||
|
|||
|
|||
class Client(threading.local): | |||
"""Object representing a pool of memcache servers. | |||
r"""Object representing a pool of memcache servers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r"""Object representing a pool of memcache servers.
it's correct to start with the letter "r" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is valid.
Both string and bytes literals may optionally be prefixed with a letter 'r' or 'R'; such strings are called raw strings and treat backslashes as literal characters. As a result, in string literals, '\U' and '\u' escapes in raw strings are not treated specially. Given that Python 2.x’s raw unicode literals behave differently than Python 3.x’s the 'ur' syntax is not supported.
source: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to remove that \ in the docstring which should resolve this without the 'r'. I don't believe the \ is needed, it probably was an artifact of a continuation line. Your is -> == is included in a patch I just accepted, so I'm going to commit this change and close this PR as fixed, thank you for the PR!
is -> == done by another PR, removing spurious \ in docstring rather than converting to r string. |
Fixes #176