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

Enumerate instead of range/len. (AntiOCD) #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FluffyOMC
Copy link

No description provided.

@timonline
Copy link

What’s the point? How does it help?

@@ -112,7 +112,7 @@ def command(self, request_data, response_length):

def execute(self, response_length, *args):
cmd = str()
for i in range(len(args)):
for i in enumerate(args):
Copy link

@cclauss cclauss Sep 30, 2019

Choose a reason for hiding this comment

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

Did you test this? enumerate() returns a tuple.

Copy link

Choose a reason for hiding this comment

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

You're right, this PR makes no sense.

Copy link

@cclauss cclauss Oct 1, 2019

Choose a reason for hiding this comment

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

I believe this change is a nice optimization but it’s implementation is incomplete...

for i, arg in enumerate(args):
    # and then change all instances of "args[i]" with "arg".

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.

4 participants