I have a class with numerous methods, and so I would like to split these up into groups. This would make it easier for the user to find the method they are after. Here is a minimal example of this functionality.

```
class Greeter():

    def __init__(self, name):
        self.name = name
        self.spanish = Spanish(self)

   def generic(self):
       return f"Hello, {self.name}"

class Spanish():

        def __init__(self, greeter):
            self.grtr = greeter

        def hola(self):
            return f"Hola, {self.grtr.name}"

        def buen_dia(self):
            return f"Buenos días, {self.grtr.name}"

greeter = Greeter("Ann Example")
greeter.generic()
#> "Hello, Ann Example"
greeter.spanish.hola()
#> "Hola, Ann Example"

```

This feels like a hacky approach. Are there places people could see this failing? Is there a better solution in general?

**EDIT**

As suggested, here is a reduced example of my actual need for this functionality:

```
class Matrix():

    def __init__(self, m, n, data):
        # checks on m, n, data
        self.m = m
        self.n = n
        self.data = data
        self.decomposition = Decomposition(self)

    # many generic methods some returning more matrices
    def __add__(self, other):
        # add matrices
        return Matrix(m, n, data)

    # some methods will affect m, n, data
    def transpose(self):
        # set up new attributes
        self.m = m
        self.n = n
        self.data = data

class Decomposition():

    def __init__(self, mtrx):
        self.mtrx = mtrx

    # NB: eventually these might change m, n, data
    def QR(self):
        # do stuff for QR decomposition using self.mtrx
        return Q, R

    def LU(self):
        # do stuff for LU decomposition using self.mtrx
        return L, U

```