Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#279)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/pre-commit/mirrors-mypy: v1.10.1 →
v1.11.0](pre-commit/mirrors-mypy@v1.10.1...v1.11.0)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Charles Guo <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and shaldengeki authored Jul 23, 2024
1 parent ed918ca commit 25046f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: buildifier
- id: buildifier-lint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
additional_dependencies: [types-requests==2.31.0.20240218]
Expand Down
18 changes: 10 additions & 8 deletions py_proto/proto_import.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Any, Iterator, Optional

from py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff
from py_proto.proto_string_literal import ProtoStringLiteral
Expand Down Expand Up @@ -26,19 +26,21 @@ def __eq__(self, other) -> bool:
and (hasattr(other, "public") and self.public == other.public)
)

def __iter__(self) -> Iterator:
return iter(
{
"path": self.path.serialize(),
"weak": self.weak,
"public": self.public,
}
)

def __str__(self) -> str:
return f"<ProtoImport path={self.path.serialize()} weak={self.weak} public={self.public}>"

def __repr__(self) -> str:
return str(self)

def __dict__(self):
return {
"path": self.path.serialize(),
"weak": self.weak,
"public": self.public,
}

def normalize(self) -> "ProtoImport":
return self

Expand Down
8 changes: 4 additions & 4 deletions py_proto/proto_syntax.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from enum import Enum
from typing import Optional
from typing import Any, Iterator, Optional

from py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff
from py_proto.proto_string_literal import ProtoStringLiteral
Expand All @@ -23,15 +23,15 @@ def __init__(self, syntax: ProtoStringLiteral, *args, **kwargs):
def __eq__(self, other) -> bool:
return self.syntax == other.syntax

def __iter__(self) -> Iterator:
return iter({"syntax": self.syntax.serialize()})

def __str__(self) -> str:
return f"<ProtoSyntax syntax={self.syntax.serialize()}>"

def __repr__(self) -> str:
return str(self)

def __dict__(self):
return {"syntax": self.syntax.serialize()}

def normalize(self) -> "ProtoSyntax":
return self

Expand Down

0 comments on commit 25046f9

Please sign in to comment.