def pop_doc(stmnts): doc = pop_assignment(stmnts, '__doc__') assert isinstance(doc, _ast.Str) or doc is None return doc