﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33415	@classproperty breakes @abc.abstractmethod	Mateusz Legięcki	nobody	"I'm trying to do something weird,  but I found an interesting bug:


{{{
#!div style=""font-size: 100%""
Example:
  {{{#!python
import abc
import inspect

from django.utils.functional import classproperty


class A(metaclass=abc.ABCMeta):
    @classproperty
    @abc.abstractmethod
    def x(self):
        pass


print(inspect.isabstract(A))  # False

  }}}
}}}

This prints False. It should print True, due to method x is not implemented. 

It works a little bit better when    @abc.abstractmethod is first decorator. Then class is recoginsed as abstract. However, subclass of this class is always not-abstract.


{{{
#!div style=""font-size: 100%""
Example:
  {{{#!python
import abc
import inspect

from django.utils.functional import classproperty


class A(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    @classproperty
    def x(self):
        pass

class B(A, metaclass=abc.ABCMeta):
    pass


print(inspect.isabstract(A))  # True
print(inspect.isabstract(B))  # False

  }}}
}}}

"	Bug	closed	Utilities	4.0	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
