As is normally the case when I start typing a Stack Overflow question, I find the likely answer myself as I'm researching it. Well, today I'm posting the question anyway, along with what I think is the answer:
It does not work for integers because the .
is interpreted as a decimal point by the parser. The float example works because the parser knows that the second period must be attribute lookup -- there is no ambiguity in this case.