Coverage for kwai/core/domain/value_objects/name.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.3.0, created at 2023-09-05 17:55 +0000

1"""Module that defines a value object for a name.""" 

2from dataclasses import dataclass 

3 

4 

5@dataclass(kw_only=True, frozen=True, slots=True) 

6class Name: 

7 """A value object for a name.""" 

8 

9 first_name: str | None 

10 last_name: str | None 

11 

12 def __str__(self): 

13 """Return a string representation.""" 

14 return " ".join(filter(None, [self.first_name, self.last_name]))