Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9340417
abstractattribute.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
963 B
Subscribers
None
abstractattribute.py
View Options
# Copyright (C) 2017 the Software Heritage developers
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
class
AbstractAttribute
:
"""AbstractAttributes in a base class must be overridden by the subclass.
It's like the :func:`abc.abstractmethod` decorator, but for things that
are explicitly attributes/properties, not methods, without the need for
empty method def boilerplate. Like abc.abstractmethod, the class containing
AbstractAttributes must inherit from :class:`abc.ABC` or use the
:class:`abc.ABCMeta` metaclass.
Usage example::
import abc
class ClassContainingAnAbstractAttribute(abc.ABC):
foo = AbstractAttribute('descriptive docstring for foo')
"""
__isabstractmethod__
=
True
def
__init__
(
self
,
docstring
=
None
):
if
docstring
is
not
None
:
self
.
__doc__
=
'AbstractAttribute: '
+
docstring
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jul 4 2025, 10:38 AM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3241177
Attached To
rDLS Listers
Event Timeline
Log In to Comment