Ivo Shipkaliev <[email protected]> added the comment:
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
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42630>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com