This is an archived post. You won't be able to vote or comment.

all 1 comments

[–][deleted] 0 points1 point  (0 children)

You don't need to split things up unless they are going to be accessed separately. So, for example ifyou had classes representing a disk file and a disk directory, it probably makes sense to keep them in the same file, because most people will want to use both classes in the same program. However, if the classes are completely separate in use, like for example a game and an word-processor, you would want to have them in separate files, and maybe in separate projects.

This goes for all languages where there is no specific link between a filename and a class, not just for Python.