@@ -56,7 +56,7 @@ void export_cached_property(scope _cache)
56
56
" CachedProperty" ,
57
57
init<object, object, object, const char *, bool , boost::python::tuple, dict>(
58
58
(
59
- arg (" fget" )=object (), arg (" fset" )=object (), arg (" fdel" )=object (), arg (" doc" )=object (),
59
+ arg (" self " ), arg ( " fget" )=object (), arg (" fset" )=object (), arg (" fdel" )=object (), arg (" doc" )=object (),
60
60
arg (" unbound" )=false , arg (" args" )=boost::python::tuple (), arg (" kwargs" )=dict ()
61
61
),
62
62
" Represents a property attribute that is only"
@@ -83,10 +83,10 @@ void export_cached_property(scope _cache)
83
83
" Deleter signature: self, *args, **kwargs\n "
84
84
" :param str doc:\n "
85
85
" Documentation string for this property.\n "
86
- " :param bool unbound\n "
86
+ " :param bool unbound: \n "
87
87
" Whether the cached objects should be independently maintained rather than bound to"
88
88
" the instance they belong to. The cache will be slightly slower to lookup, but this can"
89
- " be required in certain cases to prevent circular references/memory leak .\n "
89
+ " be required for instances that do not have a `__dict__` attribute .\n "
90
90
" :param tuple args:\n "
91
91
" Extra arguments passed to the getter, setter and deleter functions.\n "
92
92
" :param dict kwargs:\n "
@@ -111,7 +111,8 @@ void export_cached_property(scope _cache)
111
111
" The function to register as getter function.\n "
112
112
" \n "
113
113
" :rtype:\n "
114
- " function"
114
+ " function" ,
115
+ args (" self" , " fget" )
115
116
);
116
117
117
118
CachedProperty.add_property (
@@ -134,7 +135,8 @@ void export_cached_property(scope _cache)
134
135
" The function to register as setter function.\n "
135
136
" \n "
136
137
" :rtype:\n "
137
- " function"
138
+ " function" ,
139
+ args (" self" , " fset" )
138
140
);
139
141
140
142
CachedProperty.add_property (
@@ -157,7 +159,8 @@ void export_cached_property(scope _cache)
157
159
" The function to register as deleter function.\n "
158
160
" \n "
159
161
" :rtype:\n "
160
- " function"
162
+ " function" ,
163
+ args (" self" , " fdel" )
161
164
);
162
165
163
166
CachedProperty.add_property (
@@ -190,6 +193,16 @@ void export_cached_property(scope _cache)
190
193
" str"
191
194
);
192
195
196
+ CachedProperty.add_property (
197
+ " owner" ,
198
+ &CCachedProperty::get_owner,
199
+ " The owner class this property attribute was bound to.\n "
200
+ " \n "
201
+ " :rtype:\n "
202
+ " type"
203
+ );
204
+
205
+
193
206
CachedProperty.def_readwrite (
194
207
" args" ,
195
208
&CCachedProperty::m_args,
@@ -212,30 +225,51 @@ void export_cached_property(scope _cache)
212
225
" __set_name__" ,
213
226
&CCachedProperty::__set_name__,
214
227
" Called when this property is being bound to a class.\n "
228
+ " \n "
229
+ " :param class owner:\n "
230
+ " The class this property is being bound to.\n "
231
+ " :param str name:\n "
232
+ " The name this property is being bound as." ,
233
+ args (" self" , " owner" , " name" )
215
234
);
216
235
217
236
CachedProperty.def (
218
237
" __get__" ,
219
238
&CCachedProperty::__get__,
220
239
" Retrieves the value of this property.\n "
221
240
" \n "
241
+ " :param object instance:\n "
242
+ " The instance for which this property is retrieved.\n "
243
+ " :param class owner:\n "
244
+ " The class for which this property is retrieved.\n "
245
+ " \n "
222
246
" :rtype:\n "
223
- " object"
247
+ " object" ,
248
+ (" self" , " instance" , arg (" owner" )=object ())
224
249
);
225
250
226
251
CachedProperty.def (
227
252
" __set__" ,
228
253
&CCachedProperty::__set__,
229
254
" Assigns the value of this property.\n "
230
255
" \n "
256
+ " :param object instance:\n "
257
+ " The instance this property is being assigned to.\n "
258
+ " :param object value:\n "
259
+ " The value assigned to this property.\n "
231
260
" :rtype:\n "
232
- " object"
261
+ " object" ,
262
+ args (" self" , " instance" , " value" )
233
263
);
234
264
235
265
CachedProperty.def (
236
266
" __delete__" ,
237
267
&CCachedProperty::__delete__,
238
- " Deletes this property and invalidates its cached value."
268
+ " Deletes this property and invalidates its cached value.\n "
269
+ " \n "
270
+ " :param object instance:\n "
271
+ " The instance for which this property if being deleted." ,
272
+ args (" self" , " instance" )
239
273
);
240
274
241
275
CachedProperty.def (
@@ -247,7 +281,8 @@ void export_cached_property(scope _cache)
247
281
" The function to register as getter function.\n "
248
282
" \n "
249
283
" :rtype:\n "
250
- " function"
284
+ " function" ,
285
+ args (" self" , " fget" )
251
286
);
252
287
253
288
CachedProperty.def (
@@ -259,7 +294,8 @@ void export_cached_property(scope _cache)
259
294
" The name of the keyword.\n "
260
295
" \n "
261
296
" :rtype:"
262
- " object"
297
+ " object" ,
298
+ args (" self" , " item" )
263
299
);
264
300
265
301
CachedProperty.def (
@@ -270,7 +306,8 @@ void export_cached_property(scope _cache)
270
306
" :param str item:\n "
271
307
" The name of the keyword.\n "
272
308
" :param object value:\n "
273
- " The value to assign to the given keyword."
309
+ " The value to assign to the given keyword." ,
310
+ args (" self" , " item" , " value" )
274
311
);
275
312
276
313
CachedProperty.def (
@@ -292,7 +329,7 @@ void export_cached_property(scope _cache)
292
329
" If the given descriptor doesn't have the required methods.\n "
293
330
" :raises TypeError:\n "
294
331
" If the getter, setter or deleter are not callable." ,
295
- (" descriptor" , arg (" owner" )=object (), arg (" name" )=str ())
332
+ (" descriptor" , arg (" owner" )=object (), arg (" name" )=str (), arg ( " unbound " )= false )
296
333
)
297
334
.staticmethod (" wrap_descriptor" );
298
335
0 commit comments