'Python representation of a frame.
The string returned is a valid Python expression to construct
a copy of this frame.'

def __repr__(self):

    kw = []
    for attr in self._framespec:
        if hasattr(self, attr.name):
            kw.append(('%s=%r' % (attr.name, getattr(self, attr.name))))
    for attr in self._optionalspec:
        if hasattr(self, attr.name):
            kw.append(('%s=%r' % (attr.name, getattr(self, attr.name))))
    return ('%s(%s)' % (type(self).__name__, ',    '.join(kw)))
