mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Convert namedtuples to class syntax (#3321)
This commit is contained in:
@@ -5,13 +5,12 @@ import sys
|
||||
from typing import Any, NamedTuple, Optional, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
SndHeaders = NamedTuple('SndHeaders', [
|
||||
('filetype', str),
|
||||
('framerate', int),
|
||||
('nchannels', int),
|
||||
('nframes', int),
|
||||
('sampwidth', Union[int, str]),
|
||||
])
|
||||
class SndHeaders(NamedTuple):
|
||||
filetype: str
|
||||
framerate: int
|
||||
nchannels: int
|
||||
nframes: int
|
||||
sampwidth: Union[int, str]
|
||||
_SndHeaders = SndHeaders
|
||||
else:
|
||||
_SndHeaders = Tuple[str, int, int, int, Union[int, str]]
|
||||
|
||||
Reference in New Issue
Block a user