We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was looking into making a custom serializer and I was having trouble figuring out typing.
It's probably a good idea to make abstract classes with clear typing to make implementation easier.
Here's what I came up with:
import os from abc import ABC, abstractmethod from vcr.request import Request class VcrPySerializer(ABC): @abstractmethod def deserialize( self, cassette_string: str ) -> dict: pass @abstractmethod def serialize( self, cassette_dict: dict ) -> str: pass class VcrPyPersister(ABC): @abstractmethod @classmethod def load_cassette( cls, cassette_path: str | bytes | os.PathLike, serializer: VcrPySerializer )-> tuple[list[Request], list[bytes]]: pass @abstractmethod @staticmethod def save_cassette( cassette_path: str | bytes | os.PathLike, cassette_dict: dict, serializer: VcrPySerializer ) -> None: pass
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was looking into making a custom serializer and I was having trouble figuring out typing.
It's probably a good idea to make abstract classes with clear typing to make implementation easier.
Here's what I came up with:
The text was updated successfully, but these errors were encountered: