Merge lp:~mcfletch/simplegc/suggestions into lp:simplegc
Proposed by
Mike C. Fletcher
Status: | Needs review |
---|---|
Proposed branch: | lp:~mcfletch/simplegc/suggestions |
Merge into: | lp:simplegc |
Diff against target: |
245 lines (+214/-1) 5 files modified
.bzrignore (+2/-0) example/helloworldevent.py (+36/-0) example/helloworldeventcallback.py (+42/-0) example/slots.py (+131/-0) sgc/widgets/base_widget.py (+3/-1) |
To merge this branch: | bzr merge lp:~mcfletch/simplegc/suggestions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Bull | Disapprove | ||
Review via email:
|
Description of the change
Your use of eval is unnecessary, the builtin function getattr( obj, attr ) performs the same operation. There is also a 3-argument form getattr( obj, attr, default ) which would allow you to code for cases where a widget does not have an expected method.
To post a comment you must log in.
Unmerged revisions
- 263. By Mike C. Fletcher
-
Just a worked example of what a multi-callback slot mechanism might look like...
- 262. By Mike C. Fletcher
-
Ignore the egg-info directory and .eric4project directory
- 261. By Mike C. Fletcher
-
Following tutorial, creating a callback-based version of the clicky demo
- 260. By Mike C. Fletcher
-
Alter the helloworld.py example to include a basic event processing operation
- 259. By Mike C. Fletcher
-
Eliminate use of eval for a simple attribute lookup
Oh, I also sketched out a sample of a "slot" mechanism that allows multiple callbacks per event, currently just included in the examples directory.
Oh, and there's a couple new samples that follow the tutorial forward from helloworld, as I find it easiest to learn with concrete code. They get a bit too verbose for a tutorial, but maybe you'll find some way to make them useful somehow.