Skip to content

Instantly share code, notes, and snippets.

View antoine-tran's full-sized avatar

Tuan Tran antoine-tran

  • Meta | Bosch
  • Germany
View GitHub Profile
@antoine-tran
antoine-tran / gist:d641e3590d3d9c6adc2a50525ab73ff7
Last active August 16, 2024 21:30
Update a dataclass inplace
from typing import Any, ClassVar, Final, Mapping, Protocol, TypeAlias, TypeGuard, TypeVar
import typing_extensions
class DataClass(Protocol):
"""Represents a data class object."""
__dataclass_fields__: ClassVar[dict[str, Field[Any]]]