Name-mangling the class attribute att to _ClassNameatt?
- oop
- name-mangling
class Cat(object):
def __init__(self, name):
self.__name = name
kitten = Cat('Boop')
print(kitten.__name) # AttributeError: 'Cat' object has no attribute '__name'
print(kitten._Cat__name) # Boop