Skip to content

Refactor Class Structure for Dataset, Pool, Snapshot #34

@JavaScriptDude

Description

@JavaScriptDude

With current class design, its not possible to distinguish objects using isinstance(obj, <type>) because Pool and Snapshot both inherit from Dataset.

Refactor the class layout to include an 'abstract' class ZfsItem(object) which Pool, Dataset and Snapshot would all inherit from. This would give you the ability to share properties / methods whilst allowing usage of strong type assertions of all the key Objects.

I have a hard fork of your code in my own library that I'm writing called [zfslib](https://github.com/JavaScriptDude/zfslib) that includes this change. I just made the tweak and so its not fully tested but basic smoke testing passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions