Repository navigation
Conversation
| 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 += " " |
There was a problem hiding this comment.
@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 |
There was a problem hiding this comment.
this is not correct, we need a copy here
dab549d to
b352d74
Compare
|
This project is written so poorly, it’s a complete opposite to WPS!🤭 |
|
@sobolevn Let’s conduct a review at this stage, because a lot of changes have been made. (then I will continue refactoring and add WPS in this pr) |
sobolevn
left a comment
There was a problem hiding this comment.
I don't think that this project actually needs WPS :)
Because people who contribute to this project don't follow WPS.
Moreover, we don't really expect this project to grow. So, this would just create code churn :(
|
No problem, but let me improve perf for my last PR 🙏🏻🙏🏻 error_message += " "
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 += " "I suggest using list instead :) |
This is preparation for adding WPS.