6
私は次のように書かれているプロジェクト内のコードの一部を見た:どういう| =(パイプ等価)の記号は何をPythonで行いますか?
move = Move.create({
'name': repair.name,
'product_id': repair.product_id.id,
'product_uom': repair.product_uom.id or repair.product_id.uom_id.id,
'product_uom_qty': repair.product_qty,
'partner_id': repair.address_id.id,
'location_id': repair.location_id.id,
'location_dest_id': repair.location_dest_id.id,
'restrict_lot_id': repair.lot_id.id,
})
moves |= move
moves.action_done()
| =ここで意味?
「動き」の種類が何であれ、それは決まっています。これは一般的に "ビット単位の"または "集合体の集合"を意味しており、通常は 'moves = moves | move' – AChampion
[集合演算子](https://docs.python.org/2/library/sets.html)のように見えます。おそらく 'Move'クラスがこれをオーバーロードして、' Move'型のオペランドを可能にします。 –
FYI: 'set'は組み込み型です:https://docs.python.org/2/library/stdtypes.html#set – AChampion