Python: validate the wrapped index in Vertex or Edge objects where it could cause problems