コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4725 ビュー

Hello all,

I don't understand how works this python line because of the in, the and and the or.  Can you explain please?


default_amount = invoice.type in ('out_refund', 'in_refund') and -invoice.residual or invoice.residual


Thanks

アバター
破棄
著作者 最善の回答

Ok, I have found it there : 

http://python.developpez.com/cours/DiveIntoPython/php/frdiveintopython/power_of_introspection/and_or.php


At the point 4.6.1


アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 15
5189
3
3月 25
18296
0
6月 24
1569
2
2月 21
6176
0
1月 24
8714