IronPython的:双关键字无法识别? [英] IronPython: double keyword not recognised?

查看:145
本文介绍了IronPython的:双关键字无法识别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IronPython的,我可以做的:

In IronPython I can do:

Console.WriteLine(int.MaxValue)

其中的 INT 的是不是一个变量,而是System.Int32的。我得到的:

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

Max of int: 2137483647

不过,如果我尝试类似的东西的的(System.Double),我得到:

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

NameError: name 'double' is not defined.

类似地进行的字符的(System.Char)。怎么会呢?

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

推荐答案

请参阅<一href="http://ironpython.net/documentation/dotnet/dotnet.html#mapping-between-python-builtin-types-and-net-types"相对=nofollow> Python的内置类型和.NET类型之间的映射

INT 是不是一个关键字,它是一个内置式的Python和IronPython的实现它使用 System.Int32的。同样浮动使用实施 System.Double

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.

字符不是内建类型Python编写的。

double and char are not builtin types in Python.

这篇关于IronPython的:双关键字无法识别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆