• I'd really like to have that modularity that says, I'm only going to get access to the values, not by calling their names, but by calling some specific method to get access to their names.

    这样我们就丢掉了代码模块化,我很希望代码有这样模块化:,我访问变量值,不是通过直接调用它们名字,而是通过调用某个可以,访问这些变量名方法来访问。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Here's the way I would call it.

    下面是我调用方法

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So you can actually say, how do I know which methods are associated with the class? For that, we can call dir. And what it does, is it gives me back a listing of all the things, dir all the methods, that are associated with it.

    我们开始建立类了,我们得到了这些方法,因此实际上你可以说,我怎么知道,哪些方法是关联与这些类?,为了解决这个问题,我们可以调用,这个方法作用。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Notice in the class definition here, is there, this is the first thing that's got called, and I just called with the value for x and the value for y, and it went off and did something for me.

    就在这里,这是第一个被调用东西,我用x值和y调用了它,然后这个方法继续进行,并为了做了一些操作。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So another way saying it again is, when I call the class definition, by default I'm going to look to see is there an init method there, and if there is, I'm going to use it.

    当我调用定义,默认是语言要去查看,是不是有个init方法,如果有话,程序就会调用它,按照惯例。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • It's still calling cmp, but it's knowing that cmp is just reversing the order of the arguments.

    下一次我会带上正确眼镜,这还是会去调用cmp方法,但是我们知道。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定