Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- email_fields = {'txt': ('subject', 'plaintext_body'),
- 'html': ('html_body',)}
- >>> get_my_list(email_fields)
- [('txt', 'subject'), ('txt', 'plaintext_body'), ('html', 'html_body')]
- foo = starmap(product, email_fields.items())
- chain.from_iterable(foo)
- [('t', 'subject'),
- ('t', 'plaintext_body'),
- ('x', 'subject'),
- ('x', 'plaintext_body'),
- ('t', 'subject'),
- ('t', 'plaintext_body')],
- ('h', 'html_body'),
- ('t', 'html_body'),
- ('m', 'html_body'),
- ('l', 'html_body')]
- foo = [product([ext], field) for ext, field in email_fields.items()]
- chain.from_iterable(foo)
- [(k, v) for k in email_fields for v in email_fields[k]]
- [('txt', 'subject'), ('txt', 'plaintext_body'), ('html', 'html_body')]
- print [(k, item) for k in email_fields for item in email_fields[k]]
- # [('txt', 'subject'), ('txt', 'plaintext_body'), ('html', 'html_body')]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement