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 AlexWaygood
Recipients AlexWaygood, ajoino, rzepecki.t
Date 2021-08-16.11:07:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629112075.09.0.70555906923.issue44905@roundup.psfhosted.org>
In-reply-to
Content
Tomasz -- as discussed in the original BPO issue for `abstractmethod` implementations (https://bugs.python.org/issue1706989), this works as a workaround:

```
>>> from abc import ABCMeta
>>> class AbstractAttribute:
... 	__isabstractmethod__ = True
... 	
>>> class Foo(metaclass=ABCMeta):
... 	abstract_attribute_to_be_overriden = AbstractAttribute()
... 	
>>> class Bar(Foo): pass
... 
>>> b = Bar()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: Can't instantiate abstract class Bar with abstract method abstract_attribute_to_be_overriden
```

It would be nice to have something like this in the `abc` module, though.
History
Date User Action Args
2021-08-16 11:07:55AlexWaygoodsetrecipients: + AlexWaygood, ajoino, rzepecki.t
2021-08-16 11:07:55AlexWaygoodsetmessageid: <1629112075.09.0.70555906923.issue44905@roundup.psfhosted.org>
2021-08-16 11:07:55AlexWaygoodlinkissue44905 messages
2021-08-16 11:07:55AlexWaygoodcreate