I agree with the original report that the behavior is inconsistent. As Gaudenz mention, the choice for going with the token versus the value is tough. A value is not always a string and can lead to weird representations if it is a custom Python object while a token is not always readable (as Roger mentioned).
But then, if your term does not provide a title, you deserve some pain. :-) So I think going with the value is the right thing to do here, since it will work for all simple Python types well.
I agree with the original report that the behavior is inconsistent. As Gaudenz mention, the choice for going with the token versus the value is tough. A value is not always a string and can lead to weird representations if it is a custom Python object while a token is not always readable (as Roger mentioned).
But then, if your term does not provide a title, you deserve some pain. :-) So I think going with the value is the right thing to do here, since it will work for all simple Python types well.
See r123936.