import dis
import io


def distext(func):
    """
    Like dis.dis, but returns the text
    """
    file = io.StringIO()
    dis.dis(func, file=file)
    file.seek(0)
    text = file.read()
    return text