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

No need for instance attribute #199

Closed
nedbat opened this issue Jul 24, 2018 · 2 comments
Closed

No need for instance attribute #199

nedbat opened this issue Jul 24, 2018 · 2 comments
Assignees

Comments

@nedbat
Copy link

@nedbat nedbat commented Jul 24, 2018

Here (https://github.com/ets-labs/python-dependency-injector/blob/master/src/dependency_injector/providers.pyx#L90) you don't need to make an object attribute:

self.__overriding_lock = self.__class__.overriding_lock

You can simply access self.overriding_lock in your methods, since you aren't assigning to it, only calling its method.

(Sorry for the drive-by code review. Feel free to close if you don't want to change it.)

@rmk135 rmk135 self-assigned this Jul 24, 2018
@rmk135
Copy link
Member

@rmk135 rmk135 commented Jul 24, 2018

Hey @nedbat ,

Feel really proud to get a code review from you 👍 Thanks for the comment, make sense, will definitely refactor it :)

Thanks,
Roman

rmk135 added a commit that referenced this issue Jul 26, 2018
@rmk135
Copy link
Member

@rmk135 rmk135 commented Jul 26, 2018

Done at 3.12.4.

Thanks again, @nedbat!

@rmk135 rmk135 closed this Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants