Skip to content

Clarify documentation on RedisObject creation #13

@mbaruh

Description

@mbaruh

The __set_name__ docstring of RedisObject reads:

This class MUST be created as a class attribute, otherwise it will raise
exceptions whenever a method is used. This is because it uses this
method to create a namespace like `MyCog.my_class_attribute` which is
used as a hash name when we store stuff in Redis, to prevent collisions.

This gives the impression that a RedisObject is limited to being assigned to a class variable. In reality, it is possible to assign it to an instance attribute by specifying the namespace argument at init.

The docs should be amended to reflect that.

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