Opinions please -- how big should a single module grow?

Stef Mientki stef.mientki at gmail.com
Fri Jul 9 05:21:44 EDT 2010


 On 09-07-2010 06:37, Steven D'Aprano wrote:
> This is a style question rather than a programming question.
>
> How large (how many KB, lines, classes, whatever unit of code you like to 
> measure in) should a module grow before I should break it up into a 
> package? I see that, for example, decimal.py is > 3000 lines of code, so 
> I can assume that 3 KLOC is acceptable. Presumably 3000 KLOC is not. 
> Where do you draw the line?
>
> For the purposes of the discussion, you should consider that the code in 
> the module really does belong together, and that splitting it into sub-
> modules would mean arbitrarily separating code into separate files.
>
>
>
interesting question.
>From the answers already given, I assume it doesn't matter, as long as all the functionality in that
module is related.

Would it be a good idea to split a module in 2 parts,
part 1 : everything that would normally accessible from the outside
part 2 : everything that is only used inside the module

I think in this way a user of the module (that doesn't know the module yet) has a far more easier
entrance.

cheers,
Stef Mientki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100709/eb868a9e/attachment-0001.html>


More information about the Python-list mailing list