79380754

Date: 2025-01-23 11:06:39
Score: 1
Natty:
Report link

I have found a pythoninc solution through deriving the final class C from A and B.

from dataclasses import dataclass, field

@dataclass
class A:
    data_value1 : str = field(default='foo', metadata={'help': 'info about data_value2'})

@dataclass
class B(A):
    data_value2 : float = field(default=0,9, metadata={'help': 'info about data_value2'})
    def __post_init__(self):
        self.data_value2 += 10 
C = B 
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Akin Wilson