Skip to content

Commit

Permalink
Add suggestion from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
aliberts committed Jan 6, 2025
1 parent 7d5d3dd commit b1b9f5f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/huggingface_hub/hub_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from dataclasses import Field, asdict, dataclass, is_dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, List, Optional, Protocol, Tuple, Type, TypeVar, Union
from typing import Any, Callable, ClassVar, Dict, List, Optional, Protocol, Tuple, Type, TypeVar, Union

import packaging.version

Expand All @@ -24,12 +24,9 @@
)


if TYPE_CHECKING:
from _typeshed import DataclassInstance # type: ignore
else:

class DataclassInstance(Protocol): # type: ignore
__dataclass_fields__: ClassVar[Dict[str, Field]]
# Type alias for dataclass instances
class DataclassInstance(Protocol):
__dataclass_fields__: ClassVar[dict[str, Field[Any]]]


Dataclass = TypeVar("Dataclass", bound=DataclassInstance)
Expand Down

0 comments on commit b1b9f5f

Please sign in to comment.