Skip to content
Snippets Groups Projects
Commit 68199070 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

Merge branch 'master' into develop

parents 7dd69b07 e1ce3040
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,8 @@ You can use the following function to recursively turn every dict into a DictObj
Immutable
=========
Make your classes immutable. Just don't forget to assign the following way in the constructor:
Make your classes immutable. Normal assignment is only supported in the constructor,
anywhere else it's a TypeError
::
......@@ -71,4 +72,7 @@ Make your classes immutable. Just don't forget to assign the following way in th
attr: str = None
def __init__(self):
super().__setattr__('attr', 'value')
self.attr = 'value'
def illegal_op(self):
self.attr = 'test' # this will TypeError
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment