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