GNOME Bugzilla – Bug 741802
Support __all__ = [ 'TypeName' ]
Last modified: 2015-02-04 14:35:19 UTC
Instead of going through every local in the plugin just check those in __all__. This would also speed up creating extensions.
Created attachment 295059 [details] [review] Support Python plugins that define __all__ Instead of going through every local in the plugin just check those in __all__, if defined. ---- This is quite a bit easier now that we can write it directly in Python!
Review of attachment 295059 [details] [review]: See comment. Apart from that go ahead ::: loaders/python/peas-python-internal.py @@ +136,3 @@ + + except AttributeError: + keys = module.__dict__ can this also fail? if yes add a warning?
(In reply to comment #2) > Review of attachment 295059 [details] [review]: > > See comment. Apart from that go ahead > > ::: loaders/python/peas-python-internal.py > @@ +136,3 @@ > + > + except AttributeError: > + keys = module.__dict__ > > can this also fail? if yes add a warning? Nope, it is read-only according to the source. https://github.com/python/cpython/blob/master/Objects/moduleobject.c#L19
ok go ahead then
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.