So actually, the problem with static semantics is you'd like it to catch everything, you don't always get it.
因此实际上,你希望静态语义检查,能捕获所有的错误,但是经常结果不是这样的。
Weird things, bad things can happen and so one of the lessons too that will be repeated throughout the course is to actually rigorously error check and make sure that you're always thinking about your user being a bad guy.
各种古怪的事情就会蜂拥而至,所以在这个课程中我反复强调,要一丝不苟地检查错误,你就当你的用户是个调皮捣蛋的家伙。
Not everything is going to get caught in static semantics checking.
并不是所有的错误,都会在静态语义检查中被捕获。
It would definitely be wrong if we were doing this because little sanity check if you just got the single one it means what instead?
如果我们这样做就是错误的,一个小检查,如果你用单个“=“,是什么意思?
It caught the error, because it checked the types of the operands before it applied things and it says, I'm going to stop.
它捕捉到了错误,因为它在,进行运算之前检查了运算对象的类型,然后Python意识到,应该停止了。
I really do love these things. And is that right, John? OK, so my apologies that your handout is wrong. I did not think to check about the difference between these things.
我真的很喜欢这些东西,这样对不对John?,好,抱歉你们的课堂手册上面是错误的,我没想要要去检查,这些东西之间的不同。
应用推荐