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

Using asserts for argument checks is probably a bad idea #7171

Open
mitar opened this issue Feb 14, 2020 · 0 comments
Open

Using asserts for argument checks is probably a bad idea #7171

mitar opened this issue Feb 14, 2020 · 0 comments
Labels
enhancement Request for new feature and/or capability P3 Issue moderate in impact or severity

Comments

@mitar
Copy link
Member

mitar commented Feb 14, 2020

So I am looking at code here:

if resources is not None:
    assert "CPU" not in resources, "Use the 'num_cpus' argument."
    assert "GPU" not in resources, "Use the 'num_gpus' argument."

This is not a good idea. assert statements are ignored when running Python with optimizations.

Or is this the intent?

@mitar mitar added the enhancement Request for new feature and/or capability label Feb 14, 2020
@ericl ericl added the P3 Issue moderate in impact or severity label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for new feature and/or capability P3 Issue moderate in impact or severity
Projects
None yet
Development

No branches or pull requests

2 participants