Backport Python 3 `inspect` module features to 2.7