Skip to main content
2 of 4
added 37 characters in body
Joran Beasley
  • 112.9k
  • 13
  • 164
  • 184

explicit is better than implicit ... so sure you could make it more consise

def __init__(self,a,b,c):
    for k,v in locals().items():
        if k != "self":
             setattr(self,k,v)

the better question is should you ...

... that said if you want a named tuple I would recommend using a namedtuple (remember tuples have certain conditions attached to them) ... perhaps you want an ordereddict or even just a dict ...

Joran Beasley
  • 112.9k
  • 13
  • 164
  • 184