Building on what @Rashmihasija said, if you need a variable that should be shared across all instances of the class, then it’s better to declare it as a class variable, outside of __init__. Class variables are tied to the class itself, not any specific instance, meaning they are shared across all objects of that class.
For instance:
class Writer:
path = "" # Class variable, shared among all instances
custom_obj = None # Class variable for custom type, shared across all instances
Here, both path and custom_obj are class variables. They’re not tied to any single instance but are available across every instance of the Writer class.