blob: c3dc5126e6544bdce9e9eea0b9d16b4056ab9a20 [file] [log] [blame]
import collections
from itertools import repeat
def _ntuple(n):
def parse(x):
if isinstance(x, collections.Iterable):
return x
return tuple(repeat(x, n))
return parse
_single = _ntuple(1)
_pair = _ntuple(2)
_triple = _ntuple(3)
_quadruple = _ntuple(4)