[Python] What does the |= (pipe equals) sign do in Python?

Discussão em 'Python' iniciado por Stack, Agosto 12, 2025.

  1. Stack

    Stack Membro Participativo

    I saw the following piece of code in a project:

    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()


    What does the |= mean/do?

    Continue reading...

Compartilhe esta Página