哦,果然,迷惑了。 thanks。
【 在 ilovecpp (cpp) 的大作中提到: 】
: 标 题: Re: python2.5的那个Conditional Expressions 用起来不是很方便
: 发信站: 水木社区 (Thu May 1 21:13:13 2008), 转信
: 【 在 mirror (Lobsters On The Run) 的大作中提到: 】
: : 例如
: :
self.acquired = acquired if acquired is not None else QDate.currentDate()
: : 长度是74个字符,考虑是一个类的函数的语句。对于80个字符一句的,
: : 一般都得折行,那折行……还不如原来的两行合算吧。
: For this specific case, why not:
:
self.acquired = acquired or QDate.currentDate()
--
In this particular case, there is only one textEdited() signal, so the
decorator is not strictly necessary; but we always use the decorator as a
matter of good practice. For example, if a later version of PyQt introduced
another signal with the same name but with different arguments, code that
used the decorator would continue to work, but code without it would not...