[Python] How to allow _inplacevar_ operations in RestrictedPython?

Discussão em 'Python' iniciado por Stack, Maio 5, 2025.

  1. Stack

    Stack Membro Participativo

    Expressions such as:

    total_impact += impact


    in my restricted env are not allowed by default and they cause the error:


    NameError: name '_inplacevar_' is not defined
    ​

    but I would like to allow such expressions. Is there anything that I can add to the restricted globals to allow it? Anything in RestrictedPython.Guards or RestrictedPython.Eval? I can't find it so far

    Continue reading...

Compartilhe esta Página