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

7 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2024-01-01 00:00 +0000

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

2 

3from dataclasses import dataclass 

4 

5 

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

7class Name: 

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

9 

10 first_name: str | None 

11 last_name: str | None 

12 

13 def __str__(self): 

14 """Return a string representation.""" 

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