Skip to content

Commit

Permalink
Fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Nov 14, 2023
1 parent 0fd4c6f commit ec9245e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mashumaro/codecs/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CodecCodeBuilder(CodeBuilder):
def new(cls, **kwargs: Any) -> "CodecCodeBuilder":
if "attrs" not in kwargs:
kwargs["attrs"] = AttrsHolder()
return cls(AttrsHolder("__root__"), **kwargs)
return cls(AttrsHolder("__root__"), **kwargs) # type: ignore

def add_decode_method(
self,
Expand Down
4 changes: 3 additions & 1 deletion mashumaro/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class BaseConfig:
code_generation_options: List[CodeGenerationOption] = [] # type: ignore
serialization_strategy: Dict[Any, SerializationStrategyValueType] = {}
aliases: Dict[str, str] = {}
serialize_by_alias: bool = Sentinel.MISSING
serialize_by_alias: Union[
bool, Literal[Sentinel.MISSING]
] = Sentinel.MISSING
namedtuple_as_dict: bool = False
allow_postponed_evaluation: bool = True
dialect: Optional[Type[Dialect]] = None
Expand Down
6 changes: 4 additions & 2 deletions mashumaro/core/meta/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@


class AttrsHolder:
def __new__(cls, name: Optional[str] = None, *args, **kwargs):
def __new__(
cls, name: Optional[str] = None, *args: Any, **kwargs: Any
) -> Any:
ah = new_class("AttrsHolder")
ah_id = id(ah)
if not name:
Expand Down Expand Up @@ -108,7 +110,7 @@ def annotations(self) -> Sequence[str]:
return getattr(self.annotated_type, "__metadata__", [])

@cached_property
def attrs(self) -> Type:
def attrs(self) -> Any:
if self.builder.is_nailed:
return self.builder.attrs
if is_self(self.type):
Expand Down

0 comments on commit ec9245e

Please sign in to comment.