python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Class inheritance under same instance
I am trying to have multiple classes inherit from one class but use the same instance and not create a different instance each time.
class ClassA(object):
def __init__(self):
self.process_...
John
Votes: 0
Answers: 1
Removing '\n' from a string without using .translate, .replace or strip()
I'm making a simple text-based game as a learning project. I'm trying to add a feature where the user can input 'save' and their stats will be written onto a txt file named 'save.txt' so that after th...
DylanHammond2022
Votes: 0
Answers: 2
Builder pattern that requires at least two properties to be specified
I am writing a RequestBuilder class, which will handle the creation of a query string, based on the following criteria
category (String)
country (String)
keywords (String[])
page (int)
pageSize (int)...

Kotaka Danski
Votes: 0
Answers: 2
Is there a PEP styleguide for class member initialization?
Assuming I want to initialize every member variable in __init__, is there a recommended approach or style according to PEP? Especially for classes where the constructor also calls methods and has a bu...
mm rnm
Votes: 0
Answers: 0