1

Which is the best: create the modules and put them in a separate file and import them or put them all together in the same file?

Is there any significant difference?

5

1 Answer 1

3

Same as disscussion on .py and .pyc. Having modules allows you to load them faster through precompiled modules. How ever negligible, this adds to performance. Though execution speed remains the same.

Please look at the following for a detailed answer. Repeating it is not useful.

[Edit:]

Decomposing the solution in modules is always better for future maintenance and enhances readability. The performance is almost always not the primary reason for decomposition of solution into various modules.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.