Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use maybe more idiomatic assignment #8215
Eric-Arellano left a comment
Much clearer. More functional and aligns well with Scala and Python ternary expressions.
If you haven't noticed, I tend on refactoring sprints to make this one of the first changes I do to Python code :) The main reason I like this style is that it makes the intent very clear: "I'm assigning a value based on a certain condition, and nothing else." Rather than "I'm doing something based on these conditions...ends up that I only end up assigning one value, but I could add more statements if I want to!"