2
votes
3answers
146 views

When to use python function nesting?

I am writing a program that creates backup of directories. Which of the following approach is better for code organization? Create separate class for Backup and Zip logic - class BackupUtil: ...
11
votes
5answers
3k views

Is it considered Pythonic to have multiple classes defined in the same file?

In working with python for the first time, I've found that I end up writing multiple classes in the same file, which is opposed to other languages like Java, which uses one file per class. Usually, ...
14
votes
4answers
2k views

How large should a Python module be? [closed]

I was browsing a github project and found this module which has more than 8 thousands lines. Is it good practice to have that much code in a single module? Shouldn't this be split over multiple ...
6
votes
5answers
310 views

Splitting 1 large object into 2 tightly-coupled ones - good, bad?

I have a complex object (call it BusinessLogic) which provides an RPC interface to semi-trusted users. The functions in the RPC interface have to decide which procedure to call, check authorisation ...
36
votes
8answers
6k views

How can I learn to effectively write Pythonic code?

Doing a google search for "pythonic" reveals a wide range of interpretations. The wikipedia page says: A common neologism in the Python community is pythonic, which can have a wide range of ...
2
votes
1answer
336 views

Is @staticmethod proliferation a code smell?

Consider a Python class with a number of @staticmethod methods and few instance methods. The static methods don't accept an instance of the defining class as parameters. Do you think that all these ...