All Questions
Tagged with python programming-practices
6 questions
37
votes
4
answers
22k
views
Are exceptions for flow control best practice in Python?
I'm reading "Learning Python" and have come across the following:
User-defined exceptions can also signal nonerror conditions. For
instance, a search routine can be coded to raise an exception ...
29
votes
6
answers
3k
views
Turning a personal Python project into a releasable library
I'm an academic rather than a programmer, and I have many years' experience writing Python programs for my own use, to support my research. My latest project is likely to be useful to many others as ...
16
votes
5
answers
7k
views
Is monkeypatching considered good programming practice?
I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
1
vote
3
answers
246
views
What is a good method/practice I can employ to keep identical code snippits in two places in sync? Also, help documenting functionals
If I could get some input on the design of this, I would be grateful as well.
Note that I'm programming in python.
There's a function F that takes lots of data, runs some analysis on it (taking ...
0
votes
1
answer
3k
views
Instantiate a class from a config file. Where should the parse function go?
I have a class in python that is instantiated from the values of a (json) config file. I was wondering what is the best practise to do that (if there is a best practise and is not just a matter of ...
-1
votes
2
answers
10k
views
Algorithm for scheduling shifts
I am trying to write a program to help scheduling shifts for the employees of a small business. There are 28 shifts that needs to be assigned to 28 employees (so this means that each person gets a ...