为此, 清单 2 为 gram 添加了一个多元化的方法,并为 pound 添加了备用缩写和多元化版本。
To that end, Listing 2 adds a pluralized method for gram, and both alternate abbreviations and pluralized versions for pound.
我会去辩论这么写是不是更好,我也可以写一个,返回x坐标和y坐标的方法,这么做可能会更清楚一点,这是很棒的缩写,好。
So I don't know don't, John, I would argue if I'd written this better, I would have had a method that returned the x- and the y- value, and it would be cleaner to go after it that way.
函数定义的第一行也称为方法签名(method signature),以def开头(def是define这个单词的缩写)。
The first line of a function definition, also known as the method signature, begins with def (shorthand for define).
应用推荐