Skip to main content

All Questions

4 votes
1 answer
2k views

Python class naming: nested classes or composed names?

I encountered a scenario where I cannot decide on which is the best (or worst) naming strategy. The context is the following: a bracket (as in a tournament) made up of nodes, where is node is made up ...
dabadaba's user avatar
  • 2,266
14 votes
3 answers
41k views

Python classes with only one instance: When to create a (single) class instance and when to work with the class instead?

Given a Python class which will be instantiated only once, i.e. there will be only one object of the class. I was wondering in which cases it makes sense to create a single class instance instead of ...
langlauf.io's user avatar
-1 votes
1 answer
818 views

Code design: is this specific case of monkeypatching in python acceptable?

I'm using python to do some research tasks. I have a class hierarchy for "tools", where each object is an instance of a particular tool. They all share some functionality and have many similarities in ...
Greg Kramida's user avatar