Recent changes to devel

22 views
Skip to first unread message

Edward K. Ream

unread,
Jun 28, 2021, 3:58:40 PM6/28/21
to leo-editor
Adding slots to the classes in leoNodes.py has created some temporary problems. Fixing these problems has improved Leo, as I shall now explain.

Injecting the "mo" attribute into Positions

PR #2016 fixes #2012: crash in quicksearch.py. The new code is in devel. The Nav pane works again.

The fix was to remove an "unauthorized" injection of the "mo" attribute into positions. Apparently, no code ever used the "mo" attribute! Furthermore, the PosList class also injected the "mo" attribute, but no code ever used it.

The threadutil.py plugin

PR #2014 fixes #2013, hard crashes in threadutil.py. The new code is in devel. It no longer seems possible for threadutil.py to hard crash Leo.

p.pluginDict probably isn't needed

#2015 suggests adding a "pluginDict" ivar to the Position class, to provide a controlled way of extending positions. My present opinion is that such an extension mechanism isn't needed. My opinion might change as I look into #2011. We shall see.

Summary

Slots make it impossible to inject attributes into classes. Imo, this is a very good thing.

Slots have revealed weird cruft. Indirectly, slot-related hard crashes have strengthened the threadutil plugin.

I suspect that #2015 won't happen.  I'll know for sure later today or tomorrow.

Edward

Edward K. Ream

unread,
Jun 28, 2021, 8:32:40 PM6/28/21
to leo-editor
On Monday, June 28, 2021 at 2:58:40 PM UTC-5 Edward K. Ream wrote:

> I suspect that  #2015 won't happen.

Indeed not. I have just closed #2015. Imo, it is never a good idea to add attributes to either Positions or VNodes.

The straightforward fix for #2011 shows that injecting p.rclicks was never necessary. See PR #2017.

Once again, slots have cleaned up Leo.

Edward
Reply all
Reply to author
Forward
0 new messages