Skip to content

Commit

Permalink
调整 typing 写法
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Aug 5, 2023
1 parent 484125c commit b422782
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bdffont/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, key: str, reason: str):


class BdfIllegalPropertiesValue(BdfException):
def __init__(self, key: str, value: any, reason: str):
def __init__(self, key: str, value: object, reason: str):
self.key = key
self.value = value
self.reason = reason
Expand Down
6 changes: 3 additions & 3 deletions src/bdffont/font.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import re
from typing import Iterable, Iterator
from collections.abc import Iterable, Iterator

from bdffont import xlfd
from bdffont.properties import BdfProperties
Expand Down Expand Up @@ -245,9 +245,9 @@ def __init__(
properties = BdfProperties()
self.properties = properties
if comments is None:
comments = list[str]()
comments = []
self.comments = comments
self.code_point_to_glyph = dict[int, BdfGlyph]()
self.code_point_to_glyph: dict[int, BdfGlyph] = {}

@property
def resolution_xy(self) -> tuple[int, int]:
Expand Down
4 changes: 2 additions & 2 deletions src/bdffont/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(
self.bounding_box_width, self.bounding_box_height = bounding_box_size
self.bounding_box_offset_x, self.bounding_box_offset_y = bounding_box_offset
if bitmap is None:
bitmap = list[list[int]]()
bitmap = []
self.bitmap = bitmap
if comments is None:
comments = list[str]()
comments = []
self.comments = comments

@property
Expand Down
2 changes: 1 addition & 1 deletion src/bdffont/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(
if data is not None:
self.update(data)
if comments is None:
comments = list[str]()
comments = []
self.comments = comments

def __getitem__(self, key: str) -> str | int:
Expand Down

0 comments on commit b422782

Please sign in to comment.