attr_reader in Python
python, ruby
Solution
You can do this with kwargs:
class Foo():
def __init__(self, **kwargs):
self.foo = kwargs['foo']
And you pass in named arguments:
foo = Foo(foo='bar')
Of course, you might want to catch KeyError exception
Problem
Is there a "synonym" for `attr_reader`in python, like something that doesn't have to make me type out?: ``` class Foo(): def __init__(self, foo, bar, spam, spammity, spam, spam, quux, foobar, barfoo): self.foo = foo self.bar = bar self.spam = spam # And so on... ``` Just a one line thing that makes `self.foo = foo, etc.`, sort of like how ruby's `attr_reader` would make ``` @foo = foo ```