change secret types example#890
Conversation
Codecov Report
@@ Coverage Diff @@
## master #890 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 16 16
Lines 2716 2742 +26
Branches 518 521 +3
=====================================
+ Hits 2716 2742 +26
Continue to review full report at Codecov.
|
|
Looks good to me
Feel free to do this if you want credit for your contribution! |
samuelcolvin
left a comment
There was a problem hiding this comment.
looks good, but a few small things to change.
Maybe best for me to merge #884 and the PR which changes how print works in examples, which I'm working on today.
| # Standard access methods will not display the secret | ||
| print(sm) | ||
| #> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') | ||
| # > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') |
There was a problem hiding this comment.
| # > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') | |
| #> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') |
and below.
| print(sm) | ||
| #> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') | ||
| # > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********') | ||
| print(sm.password.display()) |
There was a problem hiding this comment.
.display() is deprecated after #884 which will be merged before this (try to merge in the order PRs are created unless there's a good reason not to)
There was a problem hiding this comment.
Changed to print(str(sm.password))
|
|
||
| # Standard access methods will not display the secret | ||
| print(sm) | ||
| print(str(sm.password)) |
There was a problem hiding this comment.
| print(str(sm.password)) | |
| print(repr(sm.password)) |
print(str(x)) is the same as print(x)
|
thank you very much. |
* change secret types example * add changes file * add address review comments * remove redundant str() call
Change Summary
I was examining #884, which discussed the secret types. I found that the example for secret types could be slightly more clear.
Apologies if I am in error with creating this PR, I do not have experience submitting PR to an open source code base.
Checklist
changes/<pull request or issue id>-<github username>.mdfile added describing change(see changes/README.md for details)