Initializing object variables - a Java approach, a Python approach?
<p>I have an object that needs to have some 4-5 values passed to it. To illustrate:</p>

<pre><code>class Swoosh():
    spam = ''
    eggs = ''
    swallow = ''
    coconut = ''

    [... methods ...]
</code></pre>

<p>Right now, the way to use <code>Swoosh</code> is:</p>

<pre><code>swoosh = Swoosh()
swoosh.set_spam('Spam!')
swoosh.set_eggs('Eggs!')
swoosh.set_swallow('Swallow!')
swoosh.set_coconut('Migrated.')
</code></pre>

<p>I'm having doubts whether this is Pythonic or is this too much Java influence. Or is it just necessary? Also, in case you're wondering why I'm using setters instead of simply accessing the object variables - some basic validation has to be done there, hence the <code>set_</code> methods.</p>

<p>I reckon I could provide a different way to initialize a <code>Swoosh</code> - provide an <code>__init__()</code> that would accept a <code>dict</code>/<code>list</code>?</p>

<p>Anyway, I'm just looking for help/advice from someone more experienced with this stuff.</p>

<p>Thanks in advance for any input on this.  </p>
