@@ -12,6 +12,7 @@ from typing import (
1212 Generic ,
1313 Literal ,
1414 NamedTuple ,
15+ ParamSpec ,
1516 Protocol ,
1617 TypeAlias ,
1718 TypedDict ,
@@ -379,6 +380,7 @@ getdouble = float
379380def getboolean (s ) -> bool : ...
380381
381382_Ts = TypeVarTuple ("_Ts" )
383+ _P = ParamSpec ("_P" )
382384
383385@type_check_only
384386class _GridIndexInfo (TypedDict , total = False ):
@@ -418,11 +420,19 @@ class Misc:
418420 def tk_focusFollowsMouse (self ) -> None : ...
419421 def tk_focusNext (self ) -> Misc | None : ...
420422 def tk_focusPrev (self ) -> Misc | None : ...
421- # .after() can be called without the "func" argument, but it is basically never what you want.
422- # It behaves like time.sleep() and freezes the GUI app.
423- def after (self , ms : int | Literal ["idle" ], func : Callable [[Unpack [_Ts ]], object ], * args : Unpack [_Ts ]) -> str : ...
424- # after_idle is essentially partialmethod(after, "idle")
425- def after_idle (self , func : Callable [[Unpack [_Ts ]], object ], * args : Unpack [_Ts ]) -> str : ...
423+ if sys .version_info >= (3 , 14 ):
424+ # .after() can be called without the "func" argument, but it is basically never what you want.
425+ # It behaves like time.sleep() and freezes the GUI app.
426+ def after (self , ms : int | Literal ["idle" ], func : Callable [_P , object ], * args : _P .args , ** kwargs : _P .kwargs ) -> str : ...
427+ # after_idle is essentially partialmethod(after, "idle")
428+ def after_idle (self , func : Callable [_P , object ], * args : _P .args , ** kwargs : _P .kwargs ) -> str : ...
429+ else :
430+ # .after() can be called without the "func" argument, but it is basically never what you want.
431+ # It behaves like time.sleep() and freezes the GUI app.
432+ def after (self , ms : int | Literal ["idle" ], func : Callable [[Unpack [_Ts ]], object ], * args : Unpack [_Ts ]) -> str : ...
433+ # after_idle is essentially partialmethod(after, "idle")
434+ def after_idle (self , func : Callable [[Unpack [_Ts ]], object ], * args : Unpack [_Ts ]) -> str : ...
435+
426436 def after_cancel (self , id : str ) -> None : ...
427437 if sys .version_info >= (3 , 13 ):
428438 def after_info (self , id : str | None = None ) -> tuple [str , ...]: ...
@@ -3791,16 +3801,27 @@ class _setit:
37913801# manual page: tk_optionMenu
37923802class OptionMenu (Menubutton ):
37933803 menuname : Incomplete
3794- def __init__ (
3795- # differs from other widgets
3796- self ,
3797- master : Misc | None ,
3798- variable : StringVar ,
3799- value : str ,
3800- * values : str ,
3801- # kwarg only from now on
3802- command : Callable [[StringVar ], object ] | None = ...,
3803- ) -> None : ...
3804+ if sys .version_info >= (3 , 14 ):
3805+ def __init__ (
3806+ # differs from other widgets
3807+ self ,
3808+ master : Misc | None ,
3809+ variable : StringVar ,
3810+ value : str ,
3811+ * values : str ,
3812+ command : Callable [[StringVar ], object ] | None = ...,
3813+ name : str | None = None ,
3814+ ) -> None : ...
3815+ else :
3816+ def __init__ (
3817+ # differs from other widgets
3818+ self ,
3819+ master : Misc | None ,
3820+ variable : StringVar ,
3821+ value : str ,
3822+ * values : str ,
3823+ command : Callable [[StringVar ], object ] | None = ...,
3824+ ) -> None : ...
38043825 # configure, config, cget are inherited from Menubutton
38053826 # destroy and __getitem__ are overridden, signature does not change
38063827
0 commit comments