Skip to content

Mix-in class to make implementing __dir__ in subclasses simpler #146

@benjaminp

Description

@benjaminp

Originally reported by: katyukha (Bitbucket: katyukha, GitHub: katyukha)


Hello,

I have a case, when there are few classes in inheritance chain (with multiple inheritance), and each of them have to modify result of dir(obj) applied to instances of that classes. And this code have to be compatible with both Python 2 and 3.

At this point, I have created a simple mixin class that implements basic dir method, which could be overriden in subclasses using standard super().

Mix-in code placed here: https://github.com/katyukha/openerp-proxy/blob/2288023/openerp_proxy/utils.py#L110

Will it be good Idea to include that mix-in class to this library? If so, I may create pull request for it.


Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions