aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-31 17:54:45 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-31 17:54:45 -0400
commit7f07f0b3aafa5d5cad8f6d9c2835ea2b26d7c043 (patch)
treecdf482564aef231b2e99f7516b893563e30059aa
parent54b7fb63477e275fe09760d5514d7e118c7db207 (diff)
downloadpython-mop-7f07f0b3aafa5d5cad8f6d9c2835ea2b26d7c043.tar.gz
python-mop-7f07f0b3aafa5d5cad8f6d9c2835ea2b26d7c043.zip
also set_value
-rw-r--r--mop/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mop/__init__.py b/mop/__init__.py
index 4d83191..296c013 100644
--- a/mop/__init__.py
+++ b/mop/__init__.py
@@ -227,6 +227,12 @@ def bootstrap():
name="get_value", body=get_value
))
+ def set_value(self, instance, new_value):
+ instance.slots[self.get_name()] = new_value
+ Attribute.add_method(Method.new(
+ name="set_value", body=set_value
+ ))
+
# here's the better implementation
# note that we can't replace the implementation of the methods implemented
# by the previous gen_reader because that would end up recursive