Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

tirkarthi
Copy link

Fixes #176

Copy link

@ericxiett ericxiett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@victorelec14
Copy link

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.

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" ?

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

Copy link
Owner

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!

@linsomniac
Copy link
Owner

is -> == done by another PR, removing spurious \ in docstring rather than converting to r string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SyntaxWarnings with Python 3.8
6 participants