Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: FURB110 problem with class attributes #112

Closed
bbkgh opened this issue Nov 13, 2022 · 1 comment · Fixed by #115
Closed

[Bug]: FURB110 problem with class attributes #112

bbkgh opened this issue Nov 13, 2022 · 1 comment · Fixed by #115
Assignees
Labels
bug Something isn't working

Comments

@bbkgh
Copy link
Contributor

bbkgh commented Nov 13, 2022

The Bug

The following code:

class aClass:
    bAttr = 4
    cAttr = 5


_ = aClass.bAttr if aClass.cAttr else 5

Emits the following error:

$ refurb file.py
(test.py:6:5 [FURB110]: Replace `x if x else y` with `x or y`)

But it should not be emitting an error instance because...

Version Info

Refurb: v1.6.0
Mypy: v0.981

Python Version

Python 3.11.0

Config File

# N/A

Extra Info

None

@bbkgh bbkgh added the bug Something isn't working label Nov 13, 2022
dosisod added a commit that referenced this issue Nov 13, 2022
@dosisod
Copy link
Owner

dosisod commented Nov 13, 2022

Thank you for reporting this! I should've caught this one

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants