New submission from Terry J. Reedy:

For this issue, a 'feature class' is a non-extension class with options 
configured on the config dialog.  Currently there are 4 such classes, which 
were extension classes before conversion by #27099.

Currently, an extension class option takes effect either when IDLE is restarted 
and the module reads the value, or when a new instance is created and the 
instance reads the value.  There is currently no mechanism to update existing 
instances.

As part of the conversion, I gave each feature class a reload classmethod.  The 
method is called at module level after the class is created.  The idea was that 
these methods could also be called from ConfigDialog.activate_config_changes.  
This issue implements this idea.

(Cheryl: testing the new code should be ideally be part of this patch and 
should be part of new tests for activate_config_changes you have worked on.  I 
am going with manual tests for the moment because the cutoff for 3.6.3rc1 and 
3.7.0a1 is next Monday, 12 UTC, about 55 hours from now.)

If instances reread the class attribute each time they need it, then updating 
the class attribute updates all existing instances.  An example is the 
autocomplete popup delay time.

If instances only read the class attribute in __init__ and somehow freeze the 
value, then the class needs to keep track of instances so reload can refresh 
each.  A current example of freezing is the parenmatch type.  I will have to 
either unfreeze the attribute or add a registry set.

Fixing up CodeContext will be a separate patch I am already working on.  

Applying the reload idea to extensions, in particular the example extension, is 
a much lower priority, and can wait until after the pending releases.

----------
assignee: terry.reedy
components: IDLE
messages: 302318
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Update feature classes when options are changed.
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31488>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to