Skip to content

Add pre/postcondition assert statements to backend #63

@TanGentleman

Description

@TanGentleman

I believe I can ensure type safety and correctness with all methods available to client, using if isinstance...raise TypeError to check arguments before passing to backend class objects/calling methods.

This is not a failsafe against objects not intended to be modified by the client. For instance, here is one way to delete all data from the default logfile:

analyzer = Analyze()
parser = analyzer.parser
parser.logs = []
analyzer.confirm_nuke()

This would work correctly with the current implementation, but the type of parser.logs is never exposed to client and could change as I modify the backend.

I suggest we include a method like parser.wipe_logs(), possibly even hidden to the client, but ensuring that future changes do not cause weird behavior to sensitive values.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions