The changes to ternary_op could cause a core dump.  Fix this, and rewrite the code a bit to avoid calling the same slot more than once.
The changes to ternary_op could cause a core dump.  Fix this, and
rewrite the code a bit to avoid calling the same slot more than once.

sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator