How does Python ast.Constant work with different value types?