Method: rich.style.Style.copy
Calls: 103, Exceptions: 0, Paths: 2Back
Path 1: 86 calls (0.83)
Style (86)
1def copy(self) -> "Style":
2 """Get a copy of this style.
3
4 Returns:
5 Style: A new Style instance with identical attributes.
6 """
7 if self._null:
8 return NULL_STYLE
9 style: Style = self.__new__(Style)
10 style._ansi = self._ansi
11 style._style_definition = self._style_definition
12 style._color = self._color
13 style._bgcolor = self._bgcolor
14 style._attributes = self._attributes
15 style._set_attributes = self._set_attributes
16 style._link = self._link
17 style._link_id = f"{randint(0, 999999)}" if self._link else ""
18 style._hash = self._hash
19 style._null = False
20 style._meta = self._meta
21 return style
Path 2: 17 calls (0.17)
Style (17)
1def copy(self) -> "Style":
2 """Get a copy of this style.
3
4 Returns:
5 Style: A new Style instance with identical attributes.
6 """
7 if self._null:
8 return NULL_STYLE
9 style: Style = self.__new__(Style)
10 style._ansi = self._ansi
11 style._style_definition = self._style_definition
12 style._color = self._color
13 style._bgcolor = self._bgcolor
14 style._attributes = self._attributes
15 style._set_attributes = self._set_attributes
16 style._link = self._link
17 style._link_id = f"{randint(0, 999999)}" if self._link else ""
18 style._hash = self._hash
19 style._null = False
20 style._meta = self._meta
21 return style