Providing Write-Only Attributes
00:00 Providing Write-Only Attributes. You can also create write-only attributes by tweaking how you implement the getter method of your properties. For example, you can make your getter method raise an exception every time you accesses the underlying attribute value.
.password into a write-only attribute. In the setter method of
.password, you use
os.urandom() to generate a 32-byte random string as your hashing function’s salt. To generate the hashed password, you use
Become a Member to join the conversation.