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

Turns a method into a staticmethod because no self is used. #74

Merged
merged 2 commits into from
Jun 3, 2022
Merged

Turns a method into a staticmethod because no self is used. #74

merged 2 commits into from
Jun 3, 2022

Conversation

ThibFrgsGmz
Copy link
Contributor

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s) (void)
Has Unit Tests (y/n) n
Builds Without Errors (y/n) Let CI run
Unit Tests Pass (y/n) Let CI run
Documentation Included (y/n) n

Change Description

This PR aims to transform some methods into static methods when no self is used.

Rationale

These methods do not use their bound instance.
It is advisable to decorate this type of method with the @staticmethod decorator, so that Python does not have to instantiate a linked method for each instance of this class, thus saving memory and computation.

Testing/Review Recommendations

(void)

Future Work

(void)

Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

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

See the comment on target.py

@LeStarch LeStarch closed this May 31, 2022
@LeStarch LeStarch reopened this May 31, 2022
@LeStarch LeStarch merged commit 6932c0b into nasa:devel Jun 3, 2022
@ThibFrgsGmz ThibFrgsGmz deleted the feat/no_self_so_statimethod branch July 20, 2022 21:28
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.

None yet

2 participants