Created
May 24, 2018 19:50
-
-
Save wasprobot/c339195f45c6c45d305cc667660e8641 to your computer and use it in GitHub Desktop.
An easy substitute for 'switch-case..' in python
This file contains 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 mock_get_bins(self, key): | |
return { | |
BinHelper.ROUNDED_STAR: 'rounded-bin', | |
BinHelper.UNROUNDED_STAR: 'unrounded-bin', | |
BinHelper.TOTAL_REVENUE: 'revenue-bin', | |
BinHelper.QUALITY_BONUS: 'quality-bin', | |
}[key] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment