-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Depends on: #1
Superclass for fileable structs. These are structs which represent what one could think of as a standard file format, like PNG (vs graphic, which does not), XML, etc.
Fileable subclasses must implement the methods:
to_file(self, data: BytesBuffer)from_file(self, data: BytesBuffer)
Any keyword-only arguments defined in these are keys to pull, like in calculations.
BinaryFIle essentially just sets to_file = serialize etc
These are decorated methods, so that the interfaces when calling them are like this (the returning None is only for explicitness):
def to_file(self, data: BytesBuffer) -> None: ...
def to_file(self) -> bytes: ...
def from_file(self, data: BytesBuffer) -> None: ...
def from_file(self, data: bytes) -> None: ...
# TextFile, when implemented, should also accept:
def from_file(self, data: str) -> None: ...Metadata
Metadata
Assignees
Labels
No labels