Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 3
    And the price you pay is that you don't get error checking for constructor arguments any more. Commented Jan 16, 2018 at 15:53
  • @DietrichEpp You could always insert some validation step where you do stuff to clean up/check kwargs before the update. Commented Jan 16, 2018 at 15:55
  • This does what OP is asking for, but would likely be considered poor style in Python. One of the "Zen of Python" python.org/dev/peps/pep-0020 principles is "explicit is better than implicit" and automatically assigning nameless attributes is not explicit.
    – bjmc
    Commented Jan 16, 2018 at 15:55