-
Notifications
You must be signed in to change notification settings - Fork 165
Some followup work on the --json
PR
#759
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
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
These should reduce repetition and hopefully reduce errors. Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
I broke it during a previous commit. Because Python 3.7 is EOL in two weeks, I figure we can just drop it now. Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
a07dbdd
to
becd51f
Compare
foo.py | ||
""" | ||
new_kwargs = {} | ||
for key, attr_val in self.__dict__.items(): |
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.
Just checking: there is no need to check the keys of the other dictionary as all keys are added on initiation and so the structure is the same.
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.
Correct, provided you have two ReuseInfo
objects.
I considered the cases ReuseInfo.copy(SuperReuseInfo)
and SuperReuseInfo.copy(ReuseInfo)
, but didn't write tests for them.
In the first case, the extra fields in SuperReuseInfo
are not copied over into the new object, because they're not in ReuseInfo
's dict.
In the second case, the extra fields in SuperReuseInfo
cannot be overwritten because they do not exist in ReuseInfo
.
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.
Lots of great improvements under the hood. Nice!
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.
All looks great to me. Thanks @carmenbianca
Some refactoring work on top of the work done in #654.