Skip to content

Commit 6aa2527

Browse files
committed
rename reset function
1 parent 886fa89 commit 6aa2527

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [13.3.3] - Unreleased
8+
## [13.3.3] - 2023-02-27
99

1010
### Added
1111

rich/style.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -646,12 +646,8 @@ def copy(self) -> "Style":
646646
return style
647647

648648
@lru_cache(maxsize=128)
649-
def reset(self, link: bool = True, meta: bool = True) -> "Style":
650-
"""Get a copy of this style with optionally link and meta reset to default.
651-
652-
Args:
653-
link (bool, optional): Reset links. Defaults to True.
654-
meta (bool, optional): Reset meta. Defaults to True.
649+
def clear_meta_and_links(self) -> "Style":
650+
"""Get a copy of this style with link and meta information removed.
655651
656652
Returns:
657653
Style: New style object.
@@ -665,16 +661,11 @@ def reset(self, link: bool = True, meta: bool = True) -> "Style":
665661
style._bgcolor = self._bgcolor
666662
style._attributes = self._attributes
667663
style._set_attributes = self._set_attributes
668-
if link:
669-
style._link = None
670-
style._link_id = ""
671-
else:
672-
style._link = self._link
673-
style._link_id = f"{randint(0, 999999)}" if self._link else ""
664+
style._link = None
665+
style._link_id = ""
674666
style._hash = self._hash
675667
style._null = False
676-
677-
style._meta = None if meta else self._meta
668+
style._meta = None
678669
return style
679670

680671
def update_link(self, link: Optional[str] = None) -> "Style":

0 commit comments

Comments
 (0)