Skip to content
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

[python] Introducing virtual objects with multiple sets of slots #209

Merged
merged 20 commits into from
Sep 3, 2024

Conversation

jefremof
Copy link
Contributor

Allows to fix the problem with PyMockTypeStream when it doesn't start with MockType.
Now it is possible to create multiple virtual object types, the slots for which are specified using a mask.

@tochilinak
Copy link
Member

Also, please add some unit tests for generated virtual objects. For example, add a test where you create an object without nb_add, and check with ConcretePythonInterpreter that its type doesn't have it indeed.

You might need this function

Copy link
Member

@tochilinak tochilinak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left the comments above.

@tochilinak tochilinak changed the title [python] Second step in supporting type inference: introducing multiple virtual object types support [python] Introducing virtual objects with multiple sets of slots Aug 22, 2024
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@tochilinak
Copy link
Member

tochilinak commented Aug 26, 2024

Fine with me. Waiting for review from @sergeypospelov.

Copy link
Member

@sergeypospelov sergeypospelov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor questions

@tochilinak
Copy link
Member

General comment for @sergeypospelov. This is some preliminary work for fixing a major issue: MockType now supports only all type protocols all together, so it cannot satisfy some constraint like isSubtype(HasNbAdd).not(). To be able to fix this, we need to be able to create virtual objects with different sets of slots. This PR provides an API to do that. Using it for fixing the initial problem is the next step.

@tochilinak tochilinak merged commit a94eb5b into UnitTestBot:main Sep 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants