Message349802
Given a class `A` that overloads `__getattr__`
```
class A:
def __getattr__(self, key):
return 0
```
An instance of this class is always identified as a dataclass.
```
from dataclasses import is_dataclass
a = A()
print(is_dataclass(a))
```
gives the output `True`.
Possible fix: check for the instance type.
```
is_dataclass(type(a))
```
does give the correct answer. |
|
Date |
User |
Action |
Args |
2019-08-15 12:02:15 | Johan Hidding | set | recipients:
+ Johan Hidding |
2019-08-15 12:02:15 | Johan Hidding | set | messageid: <1565870535.54.0.93577990924.issue37868@roundup.psfhosted.org> |
2019-08-15 12:02:15 | Johan Hidding | link | issue37868 messages |
2019-08-15 12:02:15 | Johan Hidding | create | |
|