Closed tiagocoutinho closed 10 months ago
master
The following code:
def f(text): if len(text) % 2: return 1 return 0
Emits the following suggestion:
$ refurb file.py file.py:2:7 [FURB115]: Replace `len(text)` with `text`
but it shouldn't because the resulting code would raise TypeError
Refurb: v1.25.0 Mypy: v1.7.1
Python 3.10.13
# N/A
None
Thank you @tiagocoutinho for opening this!
Has your issue already been fixed?
master
branch? See the docs for instructions on how to setup a local build of Refurb.The Bug
The following code:
Emits the following suggestion:
but it shouldn't because the resulting code would raise TypeError
Version Info
Python Version
Python 3.10.13
Config File
Extra Info
None