tree-sitter / py-tree-sitter

Python bindings to the Tree-sitter parsing library

Home Page:https://tree-sitter.github.io/py-tree-sitter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to understand if an object is an instance of a certain class that may be defined in another file?

Tsimopak opened this issue · comments

I have the following code in two files:

person_list.py

class AbstractPerson:
    pass

class PersonA(AbstractPerson):
    pass

class PersonB(PersonA):
    pass

code1.py

from person_list import *  # or from person_list import PersonA, PersonB

p1 = PersonA()
p2 = PersonB()

How can I find parts of the code that create instances of a subclass of AbstractPerson?

Is it possible using that library?