is it possible to dividing up a class in multiple files?

Diez B. Roggisch deets at nospam.web.de
Mon Aug 7 09:50:44 EDT 2006


Martin Höfling wrote:

> is it possible to put the methods of a class in different files? I just
> want to order them and try to keep the files small.

No, its not possible. What you can do is to create several classes and one
that inherits from all of them. 

Better yet is to not write huge classes and getting rid of strange
conventions or views that make the problem appear as such. To explain that:
I've never felt the need to spread a class over several files - au
contraire, I despise Java for forcing me to only have one top level class
per file.

Diez



More information about the Python-list mailing list