Python Forum

Full Version: strange class property
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
check https://dbader.org/blog/meaning-of-under...-in-python
in particular - part 3. Double Leading Underscore: __var
Thanks!