Python conditional assignment operator
No, the replacement is: However, wanting to use this construct is a sign of overly complicated code flow. Usually, you’d do the following: and never be unsure whether v is set or not. If it’s one of many options that can either be set or not, use a dictionary and its get method which allows a default value