This question arose from the consideration of this question :
def fringe8((px, py), (x1, y1, x2, y2)):
Personally, I was one of my pets to see a function that takes two arguments with iterations with a fixed number (like a tuple) or two or more dictionaries (like in the shotgun API ). It is simply difficult to use because of all the verbose and two-line cabinets.
Isn't it better:
>>> class Point(object): ... def __init__(self, x, y): ... self.x = x ... self.y = y ... >>> class Rect(object): ... def __init__(self, x1, y1, x2, y2): ... self.x1 = x1 ... self.y1 = y1 ... self.x2 = x2 ... self.y2 = y2 ... >>> def fringe8(point, rect): ...
Is there a situation where it is justified to take two or more iterative arguments? Obviously, this standard itertools Python library needs this, but I don't see it to be perfect in the supported flexible code.
source share