partial backport from cython-unstable: keep Python literals from loosing their type during type analysis