def inflate(doc): return UserRevision( doc['_id'], Page.inflate(doc['page']), doc['timestamp'], doc['comment'], ByteDiff.inflate(doc['diff']), doc['sha1'], Revert.inflate(doc['revert']) if doc['revert'] != None else None )