Skip to content

Make a copy for __repr__#128

Merged
bbayles merged 2 commits intomainfrom
copy-password-repr
Feb 25, 2026
Merged

Make a copy for __repr__#128
bbayles merged 2 commits intomainfrom
copy-password-repr

Conversation

@bbayles
Copy link
Collaborator

@bbayles bbayles commented Feb 25, 2026

More on issue #127, this PR switches to making a copy of the whole object to avoid introducing thread safety issues.

@bbayles bbayles merged commit 1ebed20 into main Feb 25, 2026
9 checks passed
@bbayles bbayles deleted the copy-password-repr branch February 25, 2026 20:47
self.password = password
return ret
duplicate = deepcopy(self)
duplicate.password = ''
Copy link

Choose a reason for hiding this comment

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

If I may be annoying one last time: this way it's not obvious from the outside whether there's a password set or not. How about using a placeholder that indicates the presence of data like [...]?

Suggested change
duplicate.password = ''
duplicate.password = '[...]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants