-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: Make methods that do not need to be instance methods static #2525
Conversation
build_strategy = BuildStrategy(self.build_graph) | ||
build_strategy = _TestBuildStrategy(self.build_graph) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you explain why we need this "_TestBuildStrategy" class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuildStrategy
is an abstract class so I need to create a subclass to instantiate an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and adding prefix _
to indicate it is a "private" class)
b97d294
to
1c59bf1
Compare
(manually rebase the latest develop to resolve the conflict) |
Added type hints except for ones requiring a lot effort |
…ws#2525) * chore: Make instance methods that do not need to be instance methods static * Add type hints to methods touched * Merge develop
…static
Which issue(s) does this change fix?
Why is this change necessary?
There are many instance methods do not need to be instance methods since
self
is not being used. Making it static increases readability.How does it address the issue?
Making them static. One exception, for
BuildStrategy
, the class is meant to be an abstract class, so I made its two instance methods abstract instead of static.What side effects does this change have?
no,
We don't need to change how we invoke them.
Checklist
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.