On this page
abc.abstractproperty
Prev: abc.abstractmethod | Up: abc | Next: abc.abstractstaticmethod
Rel: abc.ABC, abc.ABCMeta, abc.abstractclassmethod, abc.abstractmethod
Ref: docs.python.org — abc.abstractproperty
Tags: #public #python3 #stdlib #abc
Import
import abc
from abc import abstractproperty
Signature & Overview
abc.abstractproperty(fget=None, fset=None, fdel=None, doc=None)
A decorator indicating abstract properties.
Methods & Attributes
abstractproperty.deleter(self, object, /)— Descriptor to obtain a copy of the property with a different deleter.abstractproperty.getter(self, object, /)— Descriptor to obtain a copy of the property with a different getter.abstractproperty.setter(self, object, /)— Descriptor to obtain a copy of the property with a different setter.
Usage
from abc import ABC, abstractmethod
# Deprecated: stack @property above @abstractmethod instead
class Named(ABC):
@property
@abstractmethod
def name(self) -> str: ...
Gotchas
- Deprecated since Python 3.3: Use
@propertyover@abstractmethod.
REPL Inspect
from abc import abstractproperty
help(abstractproperty)
Linked from
Related notes
- tuts/python3/stdlib_module/abc/ABC Linked here; links to this page; shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc/ABCMeta Linked here; links to this page; shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc/abstractclassmethod Linked here; links to this page; shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc/abstractmethod Linked here; links to this page; shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc/abstractstaticmethod Linked here; links to this page; shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/abc/get_cache_token shared tags: #abc, #stdlib
- tuts/python3/stdlib_module/abc/update_abstractmethods shared tags: #abc, #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib