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

classmethods in dac.py and adc.py are used improperly #312

Open
maffoo opened this issue Jan 28, 2016 · 3 comments
Open

classmethods in dac.py and adc.py are used improperly #312

maffoo opened this issue Jan 28, 2016 · 3 comments

Comments

@maffoo
Copy link
Contributor

maffoo commented Jan 28, 2016

There are a number of class methods defined in dac.py and adc.py which are called as instance methods in all cases. In at least one case, the call also incorrectly passes a reference to the object as a first parameter, even though a class method would expect a class there (and the class parameter gets added automatically anyway, just like the self reference gets added automatically when calling regular instance methods). We should clean this up.

@maffoo maffoo mentioned this issue Jan 28, 2016
@DanielSank
Copy link
Member

I see that the invocations of regRun are plain wrong, but what's wrong with a class method being called from instances in all cases? I used class methods wherever the method does not need to know anything about the state of any instance.

@maffoo
Copy link
Contributor Author

maffoo commented Jan 28, 2016

Yeah, I guess you're right. It seemed strange to me to call a class method through an instance, but it certainly works and is even called out as OK in the docs for classmethod (https://docs.python.org/2/library/functions.html#classmethod). So I guess we just need to fix up the call site(s) that pass extra args.

@DanielSank
Copy link
Member

but it certainly works and is even called out as OK in the docs for classmethod

Yeah, I think this is a pretty standard way to use it.

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

No branches or pull requests

2 participants