Skip to main content

Pep-8 in long constrs

Ongoing

Comments

3 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Cris,

    As long as you are in a parenthesis of a function such as, e.g., \(\texttt{addConstr}\), you don't have to follow the Python indentation. However, it is strongly recommended to still indent such long expressions properly for the sake of readability.

    Using whitespaces and parentheses can help in making your code more readable as you already did in the screenshot. You might have to re-read your code in a couple of weeks, months or even years and you will be glad then to have written a readable code to start off.

    Best regards,
    Jaromił

    0
  • Cris
    Gurobi-versary
    Curious
    Conversationalist

    Ok, thanks for your answer. So It is not indispensable use parentheses if I am coding inside a gurobi function. It is just stetic and readable issue.

     

    Thanks for all  Jaromił

    Best regards.

    0

Post is closed for comments.