Guest User

Untitled

a guest
Jan 29th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. class SecureString(str):
  2.     def __new__(cls, content):
  3.         s = super(SecureString, cls).__new__(cls, '***')
  4.         s._content = content
  5.         return s
  6.  
  7.     def __str__(self):
  8.         return str.__str__(self)
  9.  
  10.     @property
  11.     def content(self):
  12.         return self._content
Advertisement
Add Comment
Please, Sign In to add comment