Closed andy-maier closed 1 month ago
Thanks for the report, regression in pylint-dev/astroid@3dbf1393de191fd10b09741badfe1b075fdadbac
cc/ @ericvergnaud, would you by chance be able to have a look? 🙏
cc/ @ericvergnaud, would you by chance be able to have a look? 🙏
Will do tomorrow
I think I encountered a regression with the same root cause:
Regressed with astroid>=3.3
:
"""Hi."""
class Foo:
"""Hi."""
def hi(self):
"""Hi."""
def __repr__(self): # E0306: __repr__ does not return str (invalid-repr-returned)
return f'{5}'
@jacobtylerwalls see https://github.com/pylint-dev/astroid/pull/2578
Bug description
The following file test_pylint.py:
causes pylint to report this issue:
I tested this with multiple pylint versions, and the first version that has this behavior is pylint 3.3.0.
Command used
Pylint output
Expected behavior
Pylint should not report this as an error, because an f-string is a string and has the startswith() method.
Pylint version
OS / Environment
macOS Sonoma 14.6.1