access to a derived class's parameters
<p>This is a follow-on to a question I asked <a href="http://stackoverflow.com/questions/11547818/access-to-init-arguments">here</a> but I didn't really know enough at the time to be clear...</p>

<p>So, I've got a base class and a derived class.  The base class needs to know the parameters used to create instances of the derived class (so that it can store them to disk and we can later recreate the derived instance). The base class itself doesn't need to take any parameters.</p>

<p>The obvious way to do this is to require the developer of the derived class to pass it's parameters into the base classes' <code>__init__()</code>.  However if possible I'd like to make it more automated; it'd be an easy mistake to get a mismatch and the whole point of the base class is to hide the machinery from those developing the derived classes.</p>

<p>I came up with this solution - is there anything wrong with this approach?</p>

<pre><code>class Base(object):
  def __new__(typ, *args, **kwargs):
    obj = object.__new__(typ)
    obj._args = args
    obj._kwargs = kwargs
    return obj

class Derived(Base):
  def __init__(self, arg1, arg2):
    pass # obviously will do stuff here

inst = Derived('salt', arg2='pepper')
print inst, inst._args, inst._kwargs
</code></pre>
