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

Update apt.py: Python golf! #27

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

Conversation

jaseg
Copy link

@jaseg jaseg commented Dec 1, 2013

Untested, should work down to python 2.7 though. Python versions prior to 2.7 do not have dict comprehension.

These changes should reduce overhead by only doing re.match/str.find once instead of twice.

Depending on the amount of matching this needs to do, it might be worth considering re2 instead of python's default re.

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.

1 participant