Created
October 25, 2022 04:42
-
-
Save iisaka51/75300c2a3b40ce6ea660d4edc0c30494 to your computer and use it in GitHub Desktop.
adict immuatble
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [8]: users[0].freeze() | |
In [9]: try: | |
...: users[0].age=20 | |
...: except AttributeError as e: | |
...: print(e) | |
...: | |
User frozen object cannot be modified. | |
In [10]: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment