secrets
Functions for working with secrets, such as API tokens.
New in version 0.4.6.
Classes:
|
Subclass of |
-
class
Secret
(value)[source] Bases:
str
Subclass of
str
that guards against accidentally printing a secret to the terminal.The actual value of the secret is accessed via the
.value
attribute.The protection should be maintained even when the secret is in a list, tuple, set or dict, but you should still refrain from printing objects containing the secret.
The secret overrides the
__eq__()
method ofstr
, so:>>> Secret("Barry as FLUFL") == "Barry as FLUFL" True
New in version 0.4.6.
Methods:
__eq__
(other)Return
self == other
.Attributes:
The actual value of the secret.