Skip to content

Instantly share code, notes, and snippets.

@photuris
Created August 31, 2016 18:11
Show Gist options
  • Save photuris/709de6c86748cfea46550d0aebc65c52 to your computer and use it in GitHub Desktop.
Save photuris/709de6c86748cfea46550d0aebc65c52 to your computer and use it in GitHub Desktop.
What's the best PEP-8 practice for accessing nested dictionaries on multiple lines?
# snip...
# PyLint complains: C0330 Wrong continued identation.
result_set = (results_report['Results']
['Metadata']
['FooBarDefinitions']
['BazBatDefinition'])
# Flake8 complains: E211 - whitespace before '['
result_set = results_report['Results'] \
['Metadata'] \
['FooBarDefinitions'] \
['BazBatDefinition']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment