Skip to main content

Replace deprecated abstractproperty

pixee:python/fix-deprecated-abstractproperty

ImportanceReview GuidanceRequires Scanning Tool
LowMerge Without ReviewNo

The @abstractproperty decorator from abc has been deprecated since Python 3.3. This is because it's possible to use @property in combination with @abstractmethod.

Our changes look like the following:

 import abc

class Foo:
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def bar():
...

If you have feedback on this codemod, please let us know!

F.A.Q.

Why is this codemod marked as Merge Without Review?

This change fixes deprecated uses and is safe.

Codemod Settings

N/A

References