mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Upgrade the pytype version to one that can parse the tkinter stubs. (#4456)
The latest pytype release fixes two pyi parser bugs that allow files
affected by them to be taken off the pytype exclude list. I removed two
`total=False` declarations in tkinter/__init__ that pytype does not like
(because it checks that `total` is present only when TypedDict is a
class's immediate parent) and which shouldn't be needed because
_InMiscNonTotal already specifies totality. I double-checked that mypy
reports no errors in 3.7 on a .py file containing:
from typing_extensions import TypedDict
Foo = TypedDict('Foo', {'x': int}, total=False)
class Bar(Foo): pass
x: Foo = {}
showing that it doesn't require `total` to be repeated.
This commit is contained in:
@@ -664,7 +664,7 @@ class Pack:
|
||||
# slaves = Misc.pack_slaves
|
||||
# pack_slaves = Misc.pack_slaves
|
||||
|
||||
class _PlaceInfo(_InMiscNonTotal, total=False): # empty dict if widget hasn't been placed
|
||||
class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed
|
||||
anchor: _Anchor
|
||||
bordermode: Literal["inside", "outside", "ignore"]
|
||||
width: str # can be int()ed (even after e.g. widget.place(height='2.3c') or similar)
|
||||
@@ -705,7 +705,7 @@ class Place:
|
||||
# slaves = Misc.place_slaves
|
||||
# place_slaves = Misc.place_slaves
|
||||
|
||||
class _GridInfo(_InMiscNonTotal, total=False): # empty dict if widget hasn't been gridded
|
||||
class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded
|
||||
column: int
|
||||
columnspan: int
|
||||
row: int
|
||||
|
||||
Reference in New Issue
Block a user