Skip to content

Using functools.cache instead of global const for caching #9

@esciara

Description

@esciara

Would this example not be a bit out of date ? Wouldn't it have been a cleaner way to cache functions results to use functools.lru_cache, or even functools.cache since python 3.9?

Here is the code for AUDIENCE, but it would apply for KEY in the same file too:

https://github.com/googlecodelabs/user-authentication-with-iap/blob/a077882f979562ed78044e1655d32897a903d059/3-HelloVerifiedUser/auth.py#L37C1-L53C1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions