Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies = [
"connectrpc",
"flask==3.1.3",
"protobuf-py>=0.1.1",
"starlette==1.6.0",
"starlette==1.7.0",
]

[build-system]
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ dev = [
"pytest-asyncio==1.4.0",
"pytest-cov==7.1.0",
"pytest-timeout==2.5.0",
"pyvoy==1.1.0",
"ruff==0.16.8",
"tombi==1.5.5",
"ty==0.0.82",
"pyvoy==1.2.0",
"ruff==0.16.9",
"tombi==1.5.7",
"ty==0.0.84",
"types-grpcio==1.83.0.20260730",
"types-protobuf==7.35.1.20260906",
"uvicorn==0.53.0",
"uvicorn==0.54.0",
"zstandard==0.25.0",

# dev dependencies only used in subprojects. Optimal structure would include these
Expand All @@ -84,7 +84,7 @@ dev = [
"protoc-gen-py==0.5.0",
]

docs = ["mkdocstrings-python==2.0.8", "zensical==0.0.63"]
docs = ["mkdocstrings-python==2.0.9", "zensical==0.0.65"]

[build-system]
requires = ["uv_build>=0.12.0,<0.13.0"]
Expand Down
8 changes: 3 additions & 5 deletions src/connectrpc/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ def __init__(
self._code = code
self._message = message

self._details = (
[m if isinstance(m, ErrorDetail) else ErrorDetail(m) for m in details]
if details
else ()
)
self._details = [
m if isinstance(m, ErrorDetail) else ErrorDetail(m) for m in details

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured avoiding the empty list allocation is an overoptimization not worth having to explain a lint suppression (if details is true for generators, which is fine here, but lint catches it since it is often not fine)

]

@property
def code(self) -> Code:
Expand Down
Loading
Loading