Closed hongweipeng closed 2 years ago
What version of Python are you using?
I can't remember off hand if there is a limitation around this with certain Python versions. I would need to go through and see if it is covered by tests.
Decorators on classes do present some problems which necessitates accessing the wrapped class.
As a workaround, this should work:
isinstance(C1(), C1.__wrapped__)
It doesn't seem to cover this specific issue, but some other problems with decorated classes can be found mentioned in:
I use python 3.8 and I think the check can be done by setting __instancecheck__
.
Added in 1.14.0.
Is it expected?