Skip to content

Conversation

@ralic
Copy link

@ralic ralic commented May 18, 2017

using : find . -name '*.py' | xargs 2to3 -w

continue
sn_atoms = sn.strip("/").split("/")
for key in app.config.keys():
for key in list(app.config.keys()):
Copy link

Choose a reason for hiding this comment

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

This could be the following instead which is faster as when iterated over dicts simply return their keys:

for key in app.config:

def check_skipped_app_config(self):
"""Check for mounted Applications that have no config."""
for sn, app in cherrypy.tree.apps.items():
for sn, app in list(cherrypy.tree.apps.items()):
Copy link

Choose a reason for hiding this comment

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

Casting the generator returned by .items() to a list is going to make the for loop slower.

@Natim
Copy link
Contributor

Natim commented Sep 4, 2017

Python 2.7 is the fastest python

Not since Python 3.5 :D

@ghost
Copy link

ghost commented Nov 16, 2019

This should be reconsidered given Python2 reaching end-of-life in January.

@sametmax
Copy link
Contributor

sametmax commented Nov 18, 2019 via email

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