__init__() compared to __init__.py
<p>I am working on a game right now but I really hate having a few thousand lines to scroll through when finding a bug to fix or a new feature has stuffed up another function. I have kept everything in one main class and when I looked into writing each function into a different file, I had one problem, I couldn't find anything</p>

<pre><code>class game:
def __init__( self ):
    self.foo = "Foo"
def function( self, bar ):
    self.bar = bar
</code></pre>

<p>so if we put it into a file system, it should look something like this</p>

<p><strong>game/</strong></p>

<ul>
<li><p><strong>__init__.py</strong></p></li>
<li><p><strong>function.py</strong></p></li>
</ul>

<p>and I do not know how to pass self or function into either init or funtion. Is there some sort of 
__brackets
__ =  ( self, bar ) code that will help me, or will I continue to have to scroll through heaps of code?</p>

<p>I was wrong in my comment, you can do as you describe, but as @Ignacio stated its not good code design. Here's an example anyway because I was curious:</p>

<pre><code>#Empty my_game 'class'
class my_game:
    pass

#Function you can put in a different file and import here
#Will become set as the new init function to 'my_game'
def my_games_init(self,x,y):
    self.x = x
    self.y = y


#Assigning 'my_games_init' function to be used as init of 'my_game' class
my_game.__init__ = my_games_init

#Make a 'my_game' instance and show that it's x and y methods were set
g = my_game(1,2)
print g.x
print g.y
</code></pre>

python filesystems init