Fix opt error when trying to access a python list with a Type object.

fixes gh-1288