Skip to content

Commit bdbbd68

Browse files
committed
Correct BValue
1 parent f3872b7 commit bdbbd68

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bencodex/types.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
from typing import Any
1+
from typing import Mapping, Sequence, Union
22

3-
__all__ = 'BValue',
3+
__all__ = (
4+
"BKey",
5+
"BValue",
6+
)
47

58

6-
BValue = Any
9+
BKey = Union[str, bytes]
10+
BValue = Union[BKey, int, None, Mapping[BKey, "BValue"], Sequence["BValue"]]
711
# Mypy currently does not support recursive types.
812
# https://github.com/python/mypy/issues/731

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ commands =
1717
[testenv:mypy]
1818
basepython = python3
1919
deps =
20-
mypy >= 0.971
20+
mypy >= 0.981
2121
commands =
22-
mypy --install-types --non-interactive -p bencodex
22+
mypy --install-types --non-interactive -p bencodex --enable-recursive-aliases
2323

2424
[flake8]
2525
exclude =

0 commit comments

Comments
 (0)