2
在Python3.2我可以这样做:Python3.2垂直链接
foo = Bar()
foo.setSomething(something1).setStatus('horizontal').setAttributes(attributes)
最终链变得很长。我有一个垂直链的痒。
foo = Bar()
foo.setSomething(something1)
.setStatus('vertical')
.setAttributes(attributes)
有没有办法做到这一点?
http://stackoverflow.com/questions/2550439 /在多行上修改正确的方式对多功能调用 – sean
http://stackoverflow.com/questions/53162/how-can-i-do-a-line-break -line-continuation-in-python – asheeshr
谢谢各位的链接。自从我用关键词“chaining”查找时,找不到任何这些问题:) – nkamm