Skip to Content
Menú
This question has been flagged
1 Respondre
4695 Vistes

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

Avatar
Descartar
Autor Best Answer

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


Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de març 15
5182
3
de març 25
18285
0
de juny 24
1564
2
de febr. 21
6172
0
de gen. 24
8709