考虑下面的代码中潜在的问题: // My code
class Person(var age: Int)
// Client's code
object Main {
def main(args: Array[String]) {
val p = new Person(age = 18)
println(p.age)
}
}
现在说以后我需要定
如何使用Python C API模拟以下Python函数? def foo(bar, baz="something or other"):
print bar, baz
(即,这样就可以通过调用它: >>> foo("hello")
hello something or other
>>> foo("hello", baz="world!")
hello world!
>>>