Message383081
Thank you very much, fellows!
Serhiy, I'm lloking at Lib/tkinter/__init__.py changes. I'd like to share my thoughts on this:
I understand your concern: "But I am not sure what is better: raise error (RuntimeError) if the global function uses _default_root which is not initialized, or create the root widget implicitly."
In the new _get_default_root() function, first we check if Support Default Root in on:
290 > if not _support_default_root:
If we get passed this block, we know that Support Default Root is on, meaning that all entities that require a master, but didn't receive one passed-in, must receive a default one. That's how I perceive the whole idea behind Support Default Root.
But later on we do:
293 > if not _default_root:
294 > if what:
295 > raise RuntimeError(f"Too early to {what}: no default root window")
At this point, if "what" evaluates to True, we raise a RuntimeError. But at this same time Support Default Root is on, and there is no default root. And clearly: ".. no default root window" error contradicts the "_support_default_root" idea.
So further on, assuming Support Default Root is on, if we instantiate a Variable with master=None, we would get: "Too early to create variable: no default root window", which makes no sense.
In my view, we should always create a default root if it's needed, provided that _support_default_root is True. Simply: Support Default Root must lead to a default root.
Best Regards |
|
Date |
User |
Action |
Args |
2020-12-15 17:24:18 | shippo_ | set | recipients:
+ shippo_, serhiy.storchaka, epaine |
2020-12-15 17:24:18 | shippo_ | set | messageid: <1608053058.82.0.479133565158.issue42630@roundup.psfhosted.org> |
2020-12-15 17:24:18 | shippo_ | link | issue42630 messages |
2020-12-15 17:24:18 | shippo_ | create | |
|