| Conditions | 2 |
| Total Lines | 17 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright Pincer 2021-Present |
||
| 14 | def with_attrs(self, **kwargs) -> _Component: |
||
| 15 | """ |
||
| 16 | Modifies attributes are returns an object with these attributes. |
||
| 17 | |||
| 18 | .. code-block:: python |
||
| 19 | |||
| 20 | some_button.with_attrs(label="A new label") |
||
| 21 | |||
| 22 | \\*\\*kwargs |
||
| 23 | Attributes to modify and their values. |
||
| 24 | """ |
||
| 25 | copied_obj = copy(self) |
||
| 26 | |||
| 27 | for key, value in kwargs.items(): |
||
| 28 | setattr(copied_obj, key, value) |
||
| 29 | |||
| 30 | return copied_obj |
||
| 31 |