Skip to content

Commit 200260e

Browse files
authored
move DndSource to tkinter/dnd.pyi (#5588)
1 parent ec80fda commit 200260e

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

stdlib/VERSIONS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ _threading_local: 3.6-
5050
_tkinter: 2.7-
5151
_tracemalloc: 3.6-
5252
_typeshed: 2.7- # not present at runtime, only for type checking
53-
_typeshed.tkinter: 3.0-
5453
_warnings: 2.7-
5554
_weakref: 2.7-
5655
_weakrefset: 2.7-

stdlib/_typeshed/tkinter.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

stdlib/tkinter/dnd.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from _typeshed.tkinter import DndSource
2-
from tkinter import Event, Misc, Tk
3-
from typing import ClassVar, Optional
1+
from tkinter import Event, Misc, Tk, Widget
2+
from typing import ClassVar, Optional, Protocol
3+
4+
class _DndSource(Protocol):
5+
def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ...
46

57
class DndHandler:
68
root: ClassVar[Optional[Tk]]
7-
def __init__(self, source: DndSource, event: Event[Misc]) -> None: ...
9+
def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ...
810
def cancel(self, event: Optional[Event[Misc]] = ...) -> None: ...
911
def finish(self, event: Optional[Event[Misc]], commit: int = ...) -> None: ...
1012
def on_motion(self, event: Event[Misc]) -> None: ...

0 commit comments

Comments
 (0)