[Python] How to refer to the class from within it (like a recursive function)

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

    For a recursive function we can do:

    def f(i):
    if i<0: return
    print i
    f(i-1)

    f(10)


    However is there a way to do the following thing?

    class A:
    # do something
    some_func(A)
    # ...

    Continue reading...

Compartilhe esta Página