diff --git a/gi/_gobject/__init__.py b/gi/_gobject/__init__.py
index 566075c..fed1182 100644
--- a/gi/_gobject/__init__.py
+++ b/gi/_gobject/__init__.py
@@ -219,6 +219,7 @@ class GObjectMeta(type):
         type.__init__(cls, name, bases, dict_)
         cls._install_properties()
         cls._type_register(cls.__dict__)
+        cls._install_methods()
 
     def _install_properties(cls):
         gproperties = getattr(cls, '__gproperties__', {})
@@ -274,6 +275,16 @@ class GObjectMeta(type):
 
         type_register(cls, namespace.get('__gtype_name__'))
 
+    def _install_methods(cls):
+        def obj_get_data(self, key):
+            return self.key
+
+        def obj_set_data(self, key, value):
+            self.key = value
+
+        cls.get_data = obj_get_data
+        cls.set_data = obj_set_data
+
 _gobject._install_metaclass(GObjectMeta)
 
 # Deprecated naming still available for backwards compatibility.
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index f1595f6..323b34f 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -15,6 +15,18 @@ class TestGObjectAPI(unittest.TestCase):
         self.assertEqual(obj.__module__,
                           'gi._gobject._gobject')
 
+    def testGetSetData(self):
+        obj = GObject.GObject()
+
+        my_obj = GObject.GObject()
+
+        obj.set_data('int', 1)
+        obj.set_data('obj', my_obj)
+
+        self.assertEqual(obj.get_data('int'), 1)
+        self.assertEqual(obj.get_data('obj'), my_obj)
+        self.assertRaises(KeyError, obj.get_data, 'nokey')
+
 
 class TestReferenceCounting(unittest.TestCase):
     def testRegularObject(self):
