
Feb. 22, 2013
2:05 p.m.
Le Thu, 21 Feb 2013 13:35:17 +0000 (UTC), Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> a écrit :
Dear all, what do you think about allowing the use of operators on ranges?
I thought of things like: a = range(1,10) b = range(5,12) intersect = a & b # equivalent to intersect = range(5,10) merge = a | b # equivalent to merge = range(1,12)
to make this work in more complex cases, like: a = range(1,10) b = range(12,15) merge = a | b # equivalent to sth. like range(range(1,10),range(12,15))
-1. range() is a contiguous sequence, not an arbitrary container. Simplicity is part of its virtues. Regards Antoine.