Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4692 Vues

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
Ignorer
Auteur Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
mars 15
5180
3
mars 25
18283
0
juin 24
1562
2
févr. 21
6172
0
janv. 24
8708