I want to know that are dunder attributes or special attributes private (not accessible outside the class)? Are dunder methods also private? If yes, then check my code comments below:
class Employee():
def __init__(self,name,age,salary,pin):
self.name=name
self.age=age
self.__salary=salary
self.__pin=pin
def __str__(self):
return f"{self.name} {self.age}"
obj1=Employee("Ali",45,"454543",234)
print(obj1.__dict__) # Is it a good practice to use __dict__(special attribute) outside the class? as they are private
print(obj1.__str__()) # Is it a good practice to use __str__ (dunder method) outside the class? as they are private