[codege/python] Use int as the type annotation for integers (#5309)

This commit is contained in:
Justin Van Patten 2020-09-11 21:56:29 +00:00 committed by GitHub
parent 4dd40e4490
commit 5e06da464a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1521,7 +1521,9 @@ func (mod *modContext) typeString(t schema.Type, input, wrapInput, optional, acc
switch t {
case schema.BoolType:
typ = "bool"
case schema.IntType, schema.NumberType:
case schema.IntType:
typ = "int"
case schema.NumberType:
typ = "float"
case schema.StringType:
typ = "str"
@ -1562,7 +1564,9 @@ func pyType(typ schema.Type) string {
switch typ {
case schema.BoolType:
return "bool"
case schema.IntType, schema.NumberType:
case schema.IntType:
return "int"
case schema.NumberType:
return "float"
case schema.StringType:
return "str"