What does “or” mean inside a Python list comprehension?

前端 未结 0 1089
野的像风
野的像风 2021-01-27 08:37

I found the following line in the Django source code:

actions.extend(self.get_action(action) for action in self.actions or [])

The argument

相关标签:
回答
  • 消灭零回复
提交回复
热议问题