type coercion
常见例句
- The == and != operators do type coercion.
和! =操作符会进行类型强制转换。 - It is statically type-checked and does not allow type coercion, so is safe with regards to types.
它进行静态类型检查,并且不允许强制类型转换,因而对于类型而言是安全的。 - The type coercion rules have changed to preserve types in arrays (more often), rather than converting to the type of a Python scalar.
改变了类型强制规则,以保持数组(更为常见)中的类型 ,而不是转换为 Python 标量的类型。 - The format is the same. I'm going to ask for some input, and then I am going to use that procedure to check, is this the right type of value. And I'm trying to use that to do the coercion if you like. Same thing if it works, I'm going to skip that, if it not, it's going to throw the exception.
格式是一样的,我需要一些输入,然后我要用一个过程来检查,是否是正确的值,然后你就可以做强制转换了,如果能运行,那是一样的,我打算跳过这段,如果不正确,那就会抛出一个异常。
麻省理工公开课 - 计算机科学及编程导论课程节选 返回 type coercion