Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 181 #183

Merged
merged 2 commits into from
Mar 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,9 @@ def uniquify(a):
# }. in
def Pin(a, b):
if isinstance(a, int) and isinstance(b, int):
return list(range(a, b + 1))

if a < b:
return list(range(a, b + 1))
return list(range(b, a + 1))[::-1]
return a in b
environment['Pin'] = Pin

Expand Down
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@
('}\\aG', 'True'),
('}2 9', '[2, 3, 4, 5, 6, 7, 8, 9]'),
('}_3 0', '[-3, -2, -1, 0]'),
('}9 4', '[9, 8, 7, 6, 5, 4]'),
('}2_2', '[2, 1, 0, -1, -2]'),
# ~
('~Z\\aZ', 'a'),
('*2~TNT', '20\n"'),
Expand Down