Python variable declaration
<p>Learning python, and has some basic doubts.</p>

<p>1.I have seen variable declaration (path here) as </p>

<pre><code>class writer:
    path = ""
</code></pre>

<p>sometimes, no explicit declaration but initialize through <code>__init__</code>. </p>

<pre><code>def __init__(self, name):
    self.name = name
</code></pre>

<p>I understand the purpose of <code>__init__</code>, but is it advisable to declare variable in any other functions.</p>

<p>2.How can I create variable to hold a custom type?</p>

<pre><code>class writer:
    path = "" # string value
    customObj = ??
</code></pre>
