标签云

微信群

扫码加入我们

WeChat QR Code


That C++ operator is called the "conditional operator" or the "ternary operator".

2018年10月24日27分04秒

I've always wondered what notation they rejected as "too confusing" in favour of this.

1970年01月01日00分03秒

Thanks for your time! That's cool!

2018年10月23日27分04秒

+1, You can use this kind of 'if' even with lambda expressions!

2018年10月23日27分04秒

Neil, not sure if you're referring to the syntax ultimately chosen, or who said "too confusing", but the PEP summarizes all the rejected alternatives among other info: python.org/dev/peps/pep-0308

2018年10月23日27分04秒

They should have used test ? a : b. The reasons cited for its rejection are weak.

2018年10月24日27分04秒

Hi, thanks for your time!

2018年10月23日27分04秒