Skip to content

Instantly share code, notes, and snippets.

@terashim
Created February 3, 2022 06:01
Show Gist options
  • Save terashim/46e225671fdae768de0aba240c57b120 to your computer and use it in GitHub Desktop.
Save terashim/46e225671fdae768de0aba240c57b120 to your computer and use it in GitHub Desktop.
Python で None を置換する ifnone 関数. Null 合体. SQL でいう IFNULL.
def ifnone(x, y):
return y if x is None else x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment