Rewrite snake case key to not use lambda for Python 2 compatibility
This commit is contained in:
5
app.py
5
app.py
@@ -14,7 +14,10 @@ from inflection import underscore
|
|||||||
|
|
||||||
# Convert keys to snake_case to conform with the twilio-python api definition contract
|
# Convert keys to snake_case to conform with the twilio-python api definition contract
|
||||||
def snake_case_keys(somedict):
|
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__)
|
app = Flask(__name__)
|
||||||
fake = Factory.create()
|
fake = Factory.create()
|
||||||
|
|||||||
Reference in New Issue
Block a user