Created
December 17, 2020 22:29
-
-
Save onelharrison/37a1d153246a5e1d2336c444f05522a6 to your computer and use it in GitHub Desktop.
Implementation of the coaselce function in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def coalesce(*values): | |
| """Return the first non-None value or None if all values are None""" | |
| return next((v for v in values if v is not None), None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment