1

IronPythonでは次のことができます。

Console.WriteLine(int.MaxValue)

ここで、intは変数ではなく、System.Int32です。私は戻ってきます:

Max of int: 2137483647

しかし、 double(System.Double)に対して同様のことを試してみると、次のようになります。

NameError: name 'double' is not defined.

char(System.Char)についても同様です。どうして?

4

1 に答える 1

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.

于 2013-01-11T12:23:04.780 に答える