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 vim_input(message = 'input', secret = False): | |
vim.command('call inputsave()') | |
vim.command("let s:user_input = %s('%s :')" % (("inputsecret" if secret else "input"), message)) | |
vim.command('call inputrestore()') | |
return vim.eval('s:user_input') |
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
@pytest.mark.parametrize( | |
('rolls', 'expected'), | |
[ | |
([1, 2], 18 + 3), | |
([10, 5, 5], 18 + 30), | |
([5, 5, 10], 18 + 30), | |
] | |
) | |
def test_10_frame(rolls, expected): | |
g = Game() |
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
class A: | |
@property | |
def value(self): | |
return 1 | |
sample_list = [A(), A(), A()] | |
print reduce(lambda x, y: x + y.value, sample_list, 0) | |
print reduce(lambda x, y: x + y, map(lambda x: x.value, sample_list)) |
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
set filetype=python |
NewerOlder