- 1

what is python 3 equivalent of that code??

if 'title' in request.json and type(request.json['title']) != unicode: abort(400) I can't figure out the correct way to use isinstance

19th Apr 2017, 6:29 PM
Brian Adams
Brian Adams - avatar
2 Respostas
+ 7
Sounds like it's Python code already ( no matter 2 or 3 ), not javascript as you tag it... and using some web serving module and/or framework ^^ Anyway, what's you real question? about the 2 lines of code or the unrelated 'isinstance'?
20th Apr 2017, 12:09 AM
visph
visph - avatar
- 1
Already got a clear simpler way type(request.json['title']) != str:
20th Apr 2017, 4:33 AM
Brian Adams
Brian Adams - avatar