This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author shippo_
Recipients epaine, serhiy.storchaka, shippo_
Date 2020-12-15.17:24:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608053058.82.0.479133565158.issue42630@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-12-15 17:24:18shippo_setrecipients: + shippo_, serhiy.storchaka, epaine
2020-12-15 17:24:18shippo_setmessageid: <1608053058.82.0.479133565158.issue42630@roundup.psfhosted.org>
2020-12-15 17:24:18shippo_linkissue42630 messages
2020-12-15 17:24:18shippo_create