mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-14 23:32:22 +08:00
Enable pyright for all Python 3 stubs (#5597)
* pyright: disable reportUnknownParameterType Unknown parameter types are preferred over Any annotations for incomplete stubs. Especially larger stubs are expected to be incomplete for some time and it would be a shame to lose the other pyright warnings for those stubs. * Also disable reportUnknownVariableType Fix problems with tkinter * Disable reportUnknownMemberType Fix pyright problems
This commit is contained in:
@@ -164,10 +164,11 @@ class EventType(str, Enum):
|
||||
VirtualEvent: str = ...
|
||||
Visibility: str = ...
|
||||
|
||||
_W = TypeVar("_W", bound="Misc")
|
||||
# Events considered covariant because you should never assign to event.widget.
|
||||
_W = TypeVar("_W", covariant=True, bound="Misc")
|
||||
_W_co = TypeVar("_W_co", covariant=True, bound="Misc")
|
||||
|
||||
class Event(Generic[_W]):
|
||||
class Event(Generic[_W_co]):
|
||||
serial: int
|
||||
num: int
|
||||
focus: bool
|
||||
@@ -185,7 +186,7 @@ class Event(Generic[_W]):
|
||||
keysym: str
|
||||
keysym_num: int
|
||||
type: EventType
|
||||
widget: _W
|
||||
widget: _W_co
|
||||
delta: int
|
||||
|
||||
def NoDefaultRoot(): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
import tkinter
|
||||
from typing import Any, List, Optional, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, Optional, Tuple, Union, overload
|
||||
from typing_extensions import Literal, TypedDict
|
||||
|
||||
NORMAL: Literal["normal"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from tkinter import Frame, Grid, Misc, Pack, Place, Scrollbar, Text
|
||||
from tkinter import Frame, Misc, Scrollbar, Text
|
||||
from typing import Any, Optional
|
||||
|
||||
# The methods from Pack, Place, and Grid are dynamically added over the parent's impls
|
||||
|
||||
@@ -2,7 +2,7 @@ import _tkinter
|
||||
import sys
|
||||
import tkinter
|
||||
from tkinter.font import _FontDescription
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload
|
||||
from typing import Any, Callable, Dict, Optional, Tuple, Union, overload
|
||||
from typing_extensions import Literal, TypedDict
|
||||
|
||||
def tclobjs_to_py(adict): ...
|
||||
|
||||
Reference in New Issue
Block a user