I wouldn't expect this to be a `TypeError` -- both contexts have the right type.  Perhaps an `AttributeError`?  It may may sense to have a custom exception type here -- something like `IndeterminateContextError`, although the name could use improvement.