Mark Dickinson <dicki...@gmail.com> added the comment: Got Sage working again. It also returns an empty list for r > n. For r negative, Combinations returns an empty list and Permutation gives an error.
sage: Combinations(range(4), 6) Combinations of [0, 1, 2, 3] of length 6 sage: Combinations(range(4), 6).list() [] sage: Permutations(range(4), 6).list() [] sage: Combinations(range(4), -1).list() [] sage: Permutations(range(4), -1).list() --------------------------------------------------------------------------- IndexError Traceback (most recent call last) [... traceback snipped ...] _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4816> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com