From c1dcd30280178d289c70749fc0ca080efe6beb5a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 21 Dec 2020 14:44:39 +0000 Subject: [PATCH] PLUGINS.md: Be explicit about why plugin_prefs(...) -> Optional[tk.Frame] --- PLUGINS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index 3ab73734..036715e6 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -225,6 +225,11 @@ with core EDMC or other plugins.** Use `numberFromString()` from EDMC's `l10n.Locale` object to parse input numbers in a locale-independent way. +Note that in the following example the function signature defines that it +returns `Optional[tk.Frame]` only because we need to allow for `None` if +something goes wrong with the creation of the frame (the calling code checks +this). You absolutely need to return the `nb.Frame()` instance that you get +as in the code below. ```python import tkinter as tk from tkinter import ttk