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

(PYL-R1720) Unnecessary else/elif used after raise #8

Closed
XenonTheInertG opened this issue Jun 26, 2021 · 0 comments
Closed

(PYL-R1720) Unnecessary else/elif used after raise #8

XenonTheInertG opened this issue Jun 26, 2021 · 0 comments

Comments

@XenonTheInertG
Copy link
Owner

Description

raise causes control flow to be disrupted, as it will exit the block. it is recommended to check other conditions using another if statement. Not preferred: ```python def check_magic_generator(attribute): magic = get_magic_number(attribute) if magic < 0: raise ValueError(f"{attribute} looks invalid") elif magic > 100 raise ValueError(f"{attribute} is very magical") else: …

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/XenonTheInertG/Rec-Boot-Bot/issue/PYL-R1720/occurrences/

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

1 participant