This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Elijah Rippeth
Recipients Elijah Rippeth
Date 2020-05-23.23:07:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590275254.34.0.427157211052.issue40749@roundup.psfhosted.org>
In-reply-to
Content
Sometimes it's desirable to couple classes together by nesting. Currently there's no way to signal to an interface implementer that an inner class is a required attribute to be implemented. 

I propose a decorator for `abstractnestedclass` to fill this gap. A simple example use-case is outlined below:

```
from abc import ABCMeta, abstractnestedclass

class BaseComponent(metaclass=ABCMeta):
    @abstractnestedclass
    class Config:
        pass

class MissingNestedComponent(BaseComponent):
    # This will raise when constructed because 
    # BaseComponent.Config is not implemented
    pass

class NonraisingComponent(BaseComponent):
    # This will be constructable
    class NonraisingComponentConfig(BaseComponent.Config):
        pass
    pass
```
History
Date User Action Args
2020-05-23 23:07:34Elijah Rippethsetrecipients: + Elijah Rippeth
2020-05-23 23:07:34Elijah Rippethsetmessageid: <1590275254.34.0.427157211052.issue40749@roundup.psfhosted.org>
2020-05-23 23:07:34Elijah Rippethlinkissue40749 messages
2020-05-23 23:07:34Elijah Rippethcreate