sourcery
sourcery copied to clipboard
"<" character disappeared
Issue description or question
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self)
is listed as
def __repr__(self):
- return "%s: %s>" % (self.__class__.__name__, self)
+ return f"{self.__class__.__name__}: {self}>"
Note the missing <
But when applying the suggestion it works anyway.
Sourcery Version
latest (?)
Code editor or IDE name and version
Pycharm v? 2022.2
OS name and version
Linux ubuntu
Hi @Alex-CodeLab ,
Thanks a lot for reporting this issue. :+1:
Do I understand it correctly?
- In the Sourcery PyCharm plugin, a diff is shown where the
<character is missing. - When you apply the refactoring, it works as expected.
That sounds strange indeed. :thinking:
We'll look into it and let you know when a fix is available.
Hi @Alex-CodeLab,
I've run this locally and I get the following suggestion which looks correct:

Please can you check you're using the latest version of Sourcery in PyCharm by going to Preferences > Plugins > Sourcery and ensure you are on version 0.12.6
My mistake, I wasn't trying this in PyCharm. I have now successfully reproduced this and have a fix for the next release
Fixed in 0.12.7