Skip to content

Commit

Permalink
Add slots to dataclasses with Python 3.10+
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 3, 2024
1 parent f289336 commit 946444b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from pathlib import Path
from types import TracebackType
from typing import (
TYPE_CHECKING,
Any,
Callable,
ContextManager,
Expand Down Expand Up @@ -60,7 +61,9 @@
else:
import async_timeout

if sys.version_info < (3, 10):
if TYPE_CHECKING:
from dataclasses import dataclass as frozen_dataclass_decorator
elif sys.version_info < (3, 10):
frozen_dataclass_decorator = functools.partial(dataclasses.dataclass, frozen=True)
else:
frozen_dataclass_decorator = functools.partial(
Expand Down

0 comments on commit 946444b

Please sign in to comment.