Skip to content

weak assumptions on class methods #170

Open
@Borda

Description

@Borda

In the readme, it is set that a class method shall not be cased if they use self, but nothing prevents top so, and the user can easily fall to wrong values; I think that we shall allow ONLY static methods and raise exceptions on anything else without making make many assumptions if the code is safe...

import cachier


class DummyClass():
    def __init__(self, state=0):
        self.state = state

    @cachier.cachier()
    def add(self, a):
        return self.state + a


object_1 = DummyClass(1)
print(object_1.add(2))
object_2 = DummyClass(2)
print(object_2.add(3))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions