Rewrite snake case key to not use lambda for Python 2 compatibility

This commit is contained in:
Jeffrey Linwood
2017-10-21 17:54:41 -05:00
parent c16b8a4557
commit cba42030ac

5
app.py
View File

@@ -14,7 +14,10 @@ from inflection import underscore
# Convert keys to snake_case to conform with the twilio-python api definition contract
def snake_case_keys(somedict):
return dict(map(lambda key, value: (underscore(key), value), somedict.items()))
snake_case_dict = {}
for key, value in somedict.items():
snake_case_dict[underscore(key)] = value
return snake_case_dict
app = Flask(__name__)
fake = Factory.create()