Split class across multiple files
tjreedy at udel.edu
Fri Nov 20 21:26:33 CET 2009
> I have a class which holds a connection to a server and a bunch of
> In this class I have methods that need to work with that connection
> and services.
> Right now there are about 50 methods some of which can be quite long.
>>From an organizational standpoint, I'd like to have method
> implementations in their own files.
> Is this possible?
A method is just function that is a class attribute.
from somemethod import somemethod # has def somemethod
somemethod = somemethod
Huge.somemethod = somemethod
> It is recommended? Should I just stop worrying
> about it and have a 5,000 line class?
I suspect some refactoring would be useful.
More information about the Python-list