From 200260e6853d64cf88869763d478712a02dd8e9b Mon Sep 17 00:00:00 2001 From: Akuli Date: Mon, 7 Jun 2021 17:07:57 +0300 Subject: [PATCH] move DndSource to tkinter/dnd.pyi (#5588) --- stdlib/VERSIONS | 1 - stdlib/_typeshed/tkinter.pyi | 7 ------- stdlib/tkinter/dnd.pyi | 10 ++++++---- 3 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 stdlib/_typeshed/tkinter.pyi diff --git a/stdlib/VERSIONS b/stdlib/VERSIONS index 7f35c5c13..3cb637f5b 100644 --- a/stdlib/VERSIONS +++ b/stdlib/VERSIONS @@ -50,7 +50,6 @@ _threading_local: 3.6- _tkinter: 2.7- _tracemalloc: 3.6- _typeshed: 2.7- # not present at runtime, only for type checking -_typeshed.tkinter: 3.0- _warnings: 2.7- _weakref: 2.7- _weakrefset: 2.7- diff --git a/stdlib/_typeshed/tkinter.pyi b/stdlib/_typeshed/tkinter.pyi deleted file mode 100644 index 2fe0c4255..000000000 --- a/stdlib/_typeshed/tkinter.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# See the README.md file in this directory for more information. - -from tkinter import Event, Misc, Widget -from typing import Optional, Protocol - -class DndSource(Protocol): - def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ... diff --git a/stdlib/tkinter/dnd.pyi b/stdlib/tkinter/dnd.pyi index 7371f91b5..71d8d3e5c 100644 --- a/stdlib/tkinter/dnd.pyi +++ b/stdlib/tkinter/dnd.pyi @@ -1,10 +1,12 @@ -from _typeshed.tkinter import DndSource -from tkinter import Event, Misc, Tk -from typing import ClassVar, Optional +from tkinter import Event, Misc, Tk, Widget +from typing import ClassVar, Optional, Protocol + +class _DndSource(Protocol): + def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ... class DndHandler: root: ClassVar[Optional[Tk]] - def __init__(self, source: DndSource, event: Event[Misc]) -> None: ... + def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ... def cancel(self, event: Optional[Event[Misc]] = ...) -> None: ... def finish(self, event: Optional[Event[Misc]], commit: int = ...) -> None: ... def on_motion(self, event: Event[Misc]) -> None: ...