Q: Using 'self' inside 2nd level function the problem is that i don't see my IDE (PyCharm) recognizing the self and coloring it with purple like always when he recognize self.
So why is self still working?
Even if ill add self as argument in func1 and in the return of func1 it still works, and still not coloring the self in purple.
Thank you. 
class Test:
    def __init__(self, word):
        self.word = word

    def __str__(self):
        return self.func1()

    def func1(self):
        def func2():
            return self.word
        return func2()


t = Test('Hi i'm printing from 2nd level func with self!')
print(t)


Hi im printing from 2nd level func with self!
Process finished with exit code 0


A: PyCharm's IDE is a very well-written convenience, but it is not required to appropriately support every last language feature.  In this case, the Python interpreter correctly carries out the operation (as required).  However, the display of PyCharm's editor apparently makes a new, independent name space for each block.  It doesn't seem to look outside the current, innermost, block to realize that self is a parameter, not merely a generic, external variable.
