Skip to content

Commit 2424d5f

Browse files
committed
Use Final for constants
Signed-off-by: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
1 parent b411aa9 commit 2424d5f

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

mbstrdecoder/__version__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
__author__ = "Tsuyoshi Hombashi"
2-
__copyright__ = f"Copyright 2016, {__author__}"
3-
__license__ = "MIT License"
1+
from typing import Final
2+
3+
4+
__author__: Final = "Tsuyoshi Hombashi"
5+
__copyright__: Final = f"Copyright 2016, {__author__}"
6+
__license__: Final = "MIT License"
47
__version__ = "1.1.3"
5-
__maintainer__ = __author__
6-
__email__ = "tsuyoshi.hombashi@gmail.com"
8+
__maintainer__: Final = __author__
9+
__email__: Final = "tsuyoshi.hombashi@gmail.com"

mbstrdecoder/_binary_ext_checker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"""
44

55
import os.path
6+
from typing import Final
67

78

89
# list from https://github.com/sindresorhus/binary-extensions
9-
binary_exts = (
10+
binary_exts: Final = (
1011
"3dm",
1112
"3ds",
1213
"3g2",

mbstrdecoder/_mbstrdecoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import copy
66
import re
77
from collections.abc import Sequence
8-
from typing import Optional
8+
from typing import Final, Optional
99

1010
from ._func import to_codec_name
1111

@@ -20,7 +20,7 @@ class MultiByteStrDecoder:
2020
https://docs.python.org/3/library/codecs.html
2121
"""
2222

23-
__CODECS = [
23+
__CODECS: Final = [
2424
"utf_7",
2525
"utf_8",
2626
"utf_8_sig",

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"""
44

55
import os.path
6+
from typing import Final
67

78
import setuptools
89

910

10-
MODULE_NAME = "mbstrdecoder"
11-
REPOSITORY_URL = f"https://github.com/thombashi/{MODULE_NAME:s}"
12-
REQUIREMENT_DIR = "requirements"
13-
ENCODING = "utf8"
11+
MODULE_NAME: Final = "mbstrdecoder"
12+
REPOSITORY_URL: Final = f"https://github.com/thombashi/{MODULE_NAME:s}"
13+
REQUIREMENT_DIR: Final = "requirements"
14+
ENCODING: Final = "utf8"
1415

1516
pkg_info: dict[str, str] = {}
1617

0 commit comments

Comments
 (0)