Skip to content

Should delete be an instance method instead of a classmethod? #1045

Open
@josenavas

Description

@josenavas

I think it makes more sense to have it as an instance method rather than a class method.

@antgonza concern is:

pd.delete()
pd.whatever = 55

However, this is not solved with the current solution:

PreprocessedData.delete(ppd.id)
ppd.whatever = 55

IMOO, I think it will be safer being an instance method because in such case we can invalidate the .id attribute by setting it to -1 and then do some decorator magic to check that value before any function is executed and raise a useful error.

What do others think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions