IronPython: double keyword not recognised?

▼魔方 西西 提交于 2019-12-24 07:41:11

问题


In IronPython I can do:

Console.WriteLine(int.MaxValue)

where int is not a variable but rather System.Int32. I get back:

Max of int: 2137483647

Yet if I try something similar for double (System.Double), I get:

NameError: name 'double' is not defined.

Similary for char (System.Char). How come?


回答1:


See Mapping between Python builtin types and .NET types

int is not a keyword, it is a builtin type in Python, and IronPython implements it using System.Int32. Similarly float is implemented using System.Double.

double and char are not builtin types in Python.



来源:https://stackoverflow.com/questions/14276256/ironpython-double-keyword-not-recognised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!