Skip to content

Replace method assignment with mixin classes #15

Description

@rfrenchseti

Qube is an enormous class, and its implementation is divided into multiple files in the extensions directory. This is done by doing things like:

from polymath.qube import Qube

from polymath.extensions import broadcaster
Qube.broadcast_into_shape = broadcaster.broadcast_into_shape
Qube.broadcast_to       = broadcaster.broadcast_to
Qube.broadcasted_shape  = broadcaster.broadcasted_shape
Qube.broadcast          = broadcaster.broadcast

This is really not a very Pythonic way to do things. Better would be to use mix-in classes. I tried to do this, and ran into some problems, particularly that there's no way to get Sphinx to show the docstrings for all the mixin superclasses. As a result I am abandoning this effort for now, but the work I did is on in PR #14 and branch rf_251204_mixins in case we ever want to resurrect it once Sphinx is fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions