ここで私が話しているのは、ネストされたクラスです。基本的に、私はモデリングしている2つのクラスがあります。DownloadManagerクラスとDownloadThreadクラス。ここでの明白なOOPの概念は構成です。でも、作曲は必ずしも入れ子という意味ではないですよね?
次のようなコードがあります。
class DownloadThread:
    def foo(self):
        pass
class DownloadManager():
    def __init__(self):
        dwld_threads = []
    def create_new_thread():
        dwld_threads.append(DownloadThread())
しかし、今は入れ子の方が良い状況があるかどうか疑問に思っています。何かのようなもの:
class DownloadManager():
    class DownloadThread:
        def foo(self):
            pass
    def __init__(self):
        dwld_threads = []
    def create_new_thread():
        dwld_threads.append(DownloadManager.DownloadThread())