Skip to content

Add wemake-python-styleguide - #214

Open
Khabib73 wants to merge 2 commits into
typeddjango:masterfrom
Khabib73:feat/add-wps
Open

Khabib73 wants to merge 2 commits into
typeddjango:masterfrom
Khabib73:feat/add-wps

Conversation

@Khabib73

Copy link
Copy Markdown
Contributor

This is preparation for adding WPS.

Comment on lines +68 to +75
error_message += " "
# sys.stderr.write(' ')
for pos in range(min(_MAX_ALIGNMENT_WIDTH, max_len)):
if word1[pos : pos + 1] != word2[pos : pos + 1]:
error_message += _ALIGNMENT_MARKER
break
else:
error_message += " "

@Khabib73 Khabib73 Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sobolevn it seems we can improve perf, we know that str is a unmutable type, which means we copy error_message on each iteration! I suggest using list instead :)

"""A context manager which allows the ability to set sys.path temporarily"""
path = sys.path[:]
"""Allow the ability to set ``sys.path`` temporarily."""
path = sys.path

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is not correct, we need a copy here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants