Re: Distributing methods of a class across multiple files
First, thanks for all the thoughtful replies. I am grateful. Second, I figured I'd get a lot of judgement about how I really shouldn't be doing this. Should have pre-empted it :-) oh well. There is a place IMHO for filename as another structuring element to help humans in search. Also it can be convenient to have two people who are working on methods for one class that have different directions to have different files (even if modern tools can handle distinct edits on the same file by multiple folks). Third, length. Well 5000 lines eh... I'm nowhere near that guess I can stick with one file. Steven thanks especially for your thorough reply about alternatives. Again I really appreciate the quality replies made here. very impressed. I had not thought of the mixin approach in particular. I was just hoping there was something like extend class Foo I could put at the top of the file and then keep writing methods indented below it. But I will think about some of these alternatives... Humbly, Luke -- http://mail.python.org/mailman/listinfo/python-list
Distributing methods of a class across multiple files
Is this possible please? I have done some searching but it is hard to narrow down Google searches to this question. What I would like to do is, for example: 1) define a class Foo in file test.py... give it some methods 2) define a file test2.py which contains a set of methods that are methods of class Foo defined in test.py. I can import Foo obviously but it isn't clear to me how to identify the methods in test2.py to be methods of class Foo defined in test.py (normally I would just indent them def's under the class but the class isn't textually in test2.py). In short I would like to distribute code for one class across multiple files so a given file doesn't get ridiculously long. Thank you, Luke -- http://mail.python.org/mailman/listinfo/python-list
Visualization of Python Class Hierarchy
I would like to automatically generate this for my program. I am running python in an eclipse context (pydev). I am not familiar with the best current tools. Thank you -- http://mail.python.org/mailman/listinfo/python-list