Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

refactor: prefer super().__setattr__ over __dict__ manipulation#174

Merged
software-dov merged 1 commit intogoogleapis:masterfrom
software-dov:super
Jan 5, 2021
Merged

refactor: prefer super().__setattr__ over __dict__ manipulation#174
software-dov merged 1 commit intogoogleapis:masterfrom
software-dov:super

Conversation

@software-dov
Copy link
Copy Markdown
Contributor

@software-dov software-dov commented Jan 5, 2021

Using super().__setattr__ is a preferred idiom over directly manipulating an object's __dict__. This allows for a more seamless transition to a named tuple subclass, or __slots__.

@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 5, 2021
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 5, 2021

Codecov Report

Merging #174 (a8ba47f) into master (ee74a03) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #174   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          862       862           
  Branches       149       149           
=========================================
  Hits           862       862           
Impacted Files Coverage Δ
proto/message.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee74a03...a8ba47f. Read the comment docs.

Copy link
Copy Markdown
Contributor

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (though I confess to not knowing the ins and outs of this Py construct)

I suggest adding a brief description of the motivation for this change to the PR description.

@software-dov software-dov added the automerge Merge the pull request once unit tests and other checks pass. label Jan 5, 2021
@software-dov software-dov merged commit 6a43682 into googleapis:master Jan 5, 2021
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 5, 2021
@software-dov software-dov deleted the super branch January 5, 2021 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants