Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tsimopak opened this issue Nov 14, 2023 · 0 comments
Labels
question Further information is requested

Comments

@Tsimopak
Copy link

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?

@ObserverOfTime ObserverOfTime added the question Further information is requested label Feb 26, 2024
@tree-sitter tree-sitter locked and limited conversation to collaborators Feb 26, 2024
@amaanq amaanq converted this issue into discussion #196 Feb 26, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants