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

Remove DAQmx_ prefix from module attributes #30

Open
eric-wieser opened this issue Jul 19, 2016 · 3 comments
Open

Remove DAQmx_ prefix from module attributes #30

eric-wieser opened this issue Jul 19, 2016 · 3 comments

Comments

@eric-wieser
Copy link
Contributor

eric-wieser commented Jul 19, 2016

That way instead of doing this and causing arbitrary namespace pollution:

from PyDAQmx import *

DAQmx_Some_Function(DAQmx_SomeConstant)

We can use the safer

import PyDAQmx

PyDAQmx.Some_Function(PyDAQmx.SomeConstant)
@eric-wieser eric-wieser changed the title Remove DAQmx_ prefix from module Remove DAQmx_ prefix from module attributes Jul 19, 2016
@petebachant
Copy link
Contributor

Great idea. Better yet, make the names comply with PEP8 so they're not so hard to type!

@clade
Copy link
Owner

clade commented Jul 20, 2016

Hi !

In the dev branch, I modify the init to add the name without the prefix. This modification is backward compatible (the from PyDAQmx import * will import the name with the prefix). Can you test it !

I hesitate to rename the function using the PEP8 for two reasons : the documentation is not available for Python but in C. The second reason is that functions are closer to C functions than to python functions. I have in mind to write real python function (for example to remove the byref and returns the value). In this case I will rename the function using the PEP8

Pierre

@eric-wieser
Copy link
Contributor Author

eric-wieser commented Jul 20, 2016

In the dev branch, I modify the __init__ to add the name without the prefix.

Looks good to me!

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

3 participants