Skip to content

Protocol merging #189

@Galtozzy

Description

@Galtozzy

Try to see if we can merge protocols in case 2 or more decorators are being applied to a single function simultaneously.

Currently, the following is true:

@cached(key='test')
@once(key='test')
async def some_operation() -> str:
    return 'result'


await some_operation.reset()  # will be valid
await some_operation.is_locked()  # type checker will report an error

I think we can detect if the function decorator is being applied to the instance of something py-cachify provides and merge protocols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions