diff options
author | Johan Dahlin <johan@src.gnome.org> | 2007-08-28 14:11:18 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2007-08-28 14:11:18 +0000 |
commit | 755b322cd9f823422aeded2c56a3256c9f1e029c (patch) | |
tree | e1b4fd1429f8cb2d1a1a63b56d9388a4b5cc09bd | |
parent | 718e09c6897666b804e7e39b8f4bd5cd9eb030a7 (diff) | |
download | pygobject-755b322cd9f823422aeded2c56a3256c9f1e029c.tar.gz |
Update documentation and filename
svn path=/trunk/; revision=701
-rw-r--r-- | gobject/propertyhelper.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gobject/propertyhelper.py b/gobject/propertyhelper.py index 9fd04134..287516b2 100644 --- a/gobject/propertyhelper.py +++ b/gobject/propertyhelper.py @@ -2,7 +2,7 @@ # pygobject - Python bindings for the GObject library # Copyright (C) 2007 Johan Dahlin # -# gobject/_property.py: GObject property wrapper/helper +# gobject/propertyhelper.py: GObject property wrapper/helper # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -35,8 +35,8 @@ from gobject.constants import \ class property(object): """ - Creates a new property which in conjunction with GObjectMeta will - create a GObject property proxy: + Creates a new property which in conjunction with GObject subclass will + create a property proxy: >>> class MyObject(gobject.GObject): >>> ... prop = gobject.property(type=str) @@ -46,6 +46,15 @@ class property(object): >>> obj.prop 'value' + + The API is similar to the builtin property: + + class AnotherObject(gobject.GObject): + @gobject.property + def prop(self): + return ... + + Which will create a read-only property called prop. """ class __metaclass__(type): |