Skip to content
New issue

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

Upgrade to Pydantic 2.x -- blocked by lnurl #10

Open
AngusP opened this issue Apr 8, 2024 · 0 comments
Open

Upgrade to Pydantic 2.x -- blocked by lnurl #10

AngusP opened this issue Apr 8, 2024 · 0 comments

Comments

@AngusP
Copy link
Owner

AngusP commented Apr 8, 2024

With only a single user supported, all the methods on PhoenixdLNURLSettings can be changed to

class PhoenixdLNURLSettings(BaseSettings):
    ...

    @pydantic.computed_field
    @functools.cached_property
    def example(self) -> Any:
        ...

Pydantic 2 docs: Computed Fields

So that their return values are computed once then cached for the lifetime of the program.

The negative impact of not caching is probably minimal, but it still feels a bit dumb to e.g. regenerate the exact same QR code and json dump string for every request

@AngusP AngusP changed the title Upgrade to Pydantic 2.x Upgrade to Pydantic 2.x -- blocked by lnurl Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant