Skip to content

Instantly share code, notes, and snippets.

@fleaplus
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fleaplus/d62e9f2579b7b9d5f535 to your computer and use it in GitHub Desktop.
Save fleaplus/d62e9f2579b7b9d5f535 to your computer and use it in GitHub Desktop.
Is this a good idea?
def filter_timezones(timezone_groups):
import re
exclude = [
'Etc', 'localtime', 'posix',
'posixrules', 'right', 'SystemV',
]
tab_files_re = '.*\\.tab$'
def is_kept(zone):
return zone not in exclude and not re.match(tab_files_re, zone)
return [( group[0], filter(is_kept, group[1]) ) for group in timezone_groups]
@fleaplus
Copy link
Author

comprehensions are cool, but is this going too far?

@mrgenixus
Copy link

I like this a lot better

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