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

add add_method_to_class() function for plugins.common #8245

Merged
merged 1 commit into from Jan 23, 2020

Conversation

@mkurnikov
Copy link
Contributor

mkurnikov commented Jan 6, 2020

  • move mypy.plugins.common.add_method() to SemanticAnalyzerPluginInterface and to SemanticAnalyzer
  • change old implementation to call new one, to preserve backwards compatibility
  • replace first ctx parameter with cls: ClassDef

Fixes #8244

@mkurnikov mkurnikov force-pushed the mkurnikov:add-method-method branch 2 times, most recently from d3ec436 to a2b63a1 Jan 6, 2020
@msullivan msullivan self-requested a review Jan 7, 2020
@mkurnikov mkurnikov closed this Jan 7, 2020
@mkurnikov mkurnikov reopened this Jan 7, 2020
Copy link
Collaborator

msullivan left a comment

I think I would prefer to just add a new function to mypy.plugins.common instead of moving into the semantic analyzer proper, unless you have a compelling reason to move it

@mkurnikov

This comment has been minimized.

Copy link
Contributor Author

mkurnikov commented Jan 8, 2020

The only reason was to make the fact that it could only be used for SemanticAnalyzer phase clearer. Does it need to be another function, or could I change a signature?

@mkurnikov mkurnikov force-pushed the mkurnikov:add-method-method branch from a2b63a1 to db4b3ad Jan 8, 2020
@mkurnikov mkurnikov changed the title Move add_method() to the SemanticAnalyzerPluginInterface split ClassDefContext in add_method() signature into cls and api Jan 8, 2020
@msullivan

This comment has been minimized.

Copy link
Collaborator

msullivan commented Jan 15, 2020

I'd prefer to add a new function, I think, to avoid breaking compatibility unnecessarily. It is kind of unfortunate, though, since it was a mistake really.

@mkurnikov mkurnikov force-pushed the mkurnikov:add-method-method branch from db4b3ad to 562de06 Jan 22, 2020
@mkurnikov mkurnikov changed the title split ClassDefContext in add_method() signature into cls and api add add_method_to_class() function for plugins.common Jan 22, 2020
@mkurnikov

This comment has been minimized.

Copy link
Contributor Author

mkurnikov commented Jan 22, 2020

I've updated, not sure about naming, let me know what you think

@msullivan msullivan merged commit 7570779 into python:master Jan 23, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@msullivan

This comment has been minimized.

Copy link
Collaborator

msullivan commented Jan 23, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.