"""Sample module.

The triple-quoted docstring contains a 'quote', a "double quote" and a
# hash that is not a comment, which is where naive highlighters give up.
"""
from dataclasses import dataclass, field


@dataclass
class FileSpec:
    path: str
    bytes_: int = 0
    tags: list[str] = field(default_factory=list)

    def describe(self) -> str:
        return f"{self.path} is {self.bytes_} bytes"


def chunks(data: bytes, size: int = 4096):
    """Yield successive slices, the last one possibly short."""
    for i in range(0, len(data), size):
        yield data[i:i + size]


if __name__ == "__main__":
    spec = FileSpec("sample.bin", 1024, ["valid"])
    print(spec.describe())
