Python Forum
strange class property - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: strange class property (/thread-22750.html)



strange class property - KaliLinux - Nov-25-2019

Why does the following program output "python is hard" ?
class t:
    def __init__(self):
        self.__t="python is hard"
t=t()
print(t._t__t)



RE: strange class property - buran - Nov-25-2019

check https://dbader.org/blog/meaning-of-underscores-in-python
in particular - part 3. Double Leading Underscore: __var


RE: strange class property - KaliLinux - Nov-25-2019

Thanks!