Skip to content

Commit 90f4ffa

Browse files
committed
Fixed mypy
1 parent 82314b4 commit 90f4ffa

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

av/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from av.codec.codec import Codec, codecs_available
1919
from av.codec.context import CodecContext
2020
from av.codec.hwaccel import HWConfig
21-
from av.container import open
21+
from av.container import open, Chapter
2222
from av.format import ContainerFormat, formats_available
2323
from av.packet import Packet
2424
from av.error import * # noqa: F403; This is limited to exception types.
@@ -41,6 +41,7 @@
4141
"AudioStream",
4242
"BitStreamFilterContext",
4343
"bitstream_filters_available",
44+
"Chapter",
4445
"Codec",
4546
"codecs_available",
4647
"CodecContext",

av/container/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .core import Container, Flags, open
1+
from .core import Chapter, Container, Flags, open
22
from .input import InputContainer
33
from .output import OutputContainer

av/container/core.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AudioCodec(IntEnum):
6767
pcm_u8 = cast(int, ...)
6868
pcm_vidc = cast(int, ...)
6969

70-
class _Chapter(TypedDict):
70+
class Chapter(TypedDict):
7171
id: int
7272
start: int
7373
end: int
@@ -102,8 +102,8 @@ class Container:
102102
) -> bool: ...
103103
def set_timeout(self, timeout: Real | None) -> None: ...
104104
def start_timeout(self) -> None: ...
105-
def chapters(self) -> list[_Chapter]: ...
106-
def set_chapters(self, chapters: list[_Chapter]) -> None: ...
105+
def chapters(self) -> list[Chapter]: ...
106+
def set_chapters(self, chapters: list[Chapter]) -> None: ...
107107

108108
@overload
109109
def open(

tests/test_chapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from fractions import Fraction
22

33
import av
4+
from av import Chapter
45

56
from .common import fate_suite
67

@@ -42,7 +43,7 @@ def test_chapters() -> None:
4243

4344

4445
def test_set_chapters() -> None:
45-
chapters = [
46+
chapters: list[Chapter] = [
4647
{
4748
"id": 1,
4849
"start": 0,

0 commit comments

Comments
 (0)