Message316343
| Author | Ricyteach |
|---|---|
| Recipients | Ricyteach, eric.smith |
| Date | 2018-05-10.02:27:35 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1525919256.17.0.682650639539.issue33452@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
The init method that comes up for int, str, float, etc is just the object init:
assert int.__init__ is object.__init__
Probably the thing to do is grab any init methods that aren't the object.__init__ while stripping out the dataclass-created init methods? Maybe something like:
import warnings
if cls.__dataclass_params__.init:
for pcls in cls.mro():
if pcls.__init__ is not object.__init__:
try:
d_params = getattr(pcls, "__dataclass_params__")
except AttributeError:
warnings.warn('Found a not called init')
else:
if not d_params.init:
warnings.warn('Found a custom dataclass init') |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-05-10 02:27:36 | Ricyteach | set | recipients: + Ricyteach, eric.smith |
| 2018-05-10 02:27:36 | Ricyteach | set | messageid: <1525919256.17.0.682650639539.issue33452@psf.upfronthosting.co.za> |
| 2018-05-10 02:27:36 | Ricyteach | link | issue33452 messages |
| 2018-05-10 02:27:35 | Ricyteach | create | |