shift introspection functions out of generator