/ Published in: Python
in case that you want to pass between multiple methods the same *args and unpack it
at the end
at the end
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class Recurse: last_t = [] def recurse(self,t): if not isinstance(t, tuple): self.last_t.append(t) else: for t1 in t: self.recurse(t1) return tuple(self.last_t) d = ((((1,2,3,'test'),),),) print Recurse().recurse(d)