-
Notifications
You must be signed in to change notification settings - Fork 185
refactor!: remove all unwanted __repr__ and __str__
#1150
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
Conversation
|
What about emojis and users? |
I don't see how making it a property is helpful? It is a very good thing that when you do |
|
First, fstrings convert using |
I have changed it to |
|
Many developers (including me) will print an object instead of the repr of the object, often because they're the same What's the reason not to have it as a property? |
It is an unnecessary breaking change imo. Also, in most cases you won't bother about the attributes of an emoji, would you? I'd assume mostly you just want to send it or create an reaction with it. I really thing having emojis like that is fine. If major complaints emerge, we still can change it at a later point. |
Catalyst4222
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A complain already has emerged, which was the reason behind the issue in the first place. Having the magic method just adds unexpected cases, while a property will only impact code when it's accessed intentionally. A property makes it more clear what code is doing, which __str__ does not
__repr__ and __str____repr__ and __str__
FINE TAKE IT ITS GONE ARE YOU HAPPY NOW :MADGE:
About
This pull request removes the
__repr__and__str__so they do not override the attrs reprChecklist
pre-commitcode linter has been run over all edited files to ensure the code is linted.3.8.6and higher.I've made this pull request: (check all that apply)
__repr__and__str__on models #1140This is: