You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(utilities): rename hold_warnings to HoldWarnings #1599
pcapkit.utilities.warnings.hold_warnings (added in #1588) is a class with a lowercase name. It is the only lowercase class pcapkit defines itself; the other, cached_property at pcapkit/utilities/compat.py:75, is a verbatim stdlib backport. It also needs # pylint: disable=invalid-name at pcapkit/utilities/warnings.py:217. The owner queried the name on #1588.
Change: rename it to HoldWarnings everywhere and drop the pylint disable. It is unreleased (1.5.0 has not shipped), so no alias is needed. References on main (589414eba):
Recorded: the owner prefers to keep the lowercase hold_warnings, because it mirrors its stdlib counterpart warnings.catch_warnings. The rename is dropped, #1601 is closed unmerged, and the invalid-name disable stays.
The #1601 review found one gap that does not depend on the name: the class is public (documented by autoclass and imported by pcapkit/protocols/protocol.py) but missing from pcapkit.utilities.warnings.__all__, which lists warn and every warning class. The stdlib exports catch_warnings the same way, so I've filed #1602 to add 'hold_warnings' to __all__.
Activity
JarryShaw commentedon Oct 10, 2026
Okay since it's matching it's Stalin counterpart, i say we keep the lower case snake name
refactor(utilities): rename hold_warnings to HoldWarnings (#1599)
JarryShaw commentedon Oct 10, 2026
Recorded: the owner prefers to keep the lowercase
hold_warnings, because it mirrors its stdlib counterpartwarnings.catch_warnings. The rename is dropped, #1601 is closed unmerged, and theinvalid-namedisable stays.The #1601 review found one gap that does not depend on the name: the class is public (documented by
autoclassand imported bypcapkit/protocols/protocol.py) but missing frompcapkit.utilities.warnings.__all__, which listswarnand every warning class. The stdlib exportscatch_warningsthe same way, so I've filed #1602 to add'hold_warnings'to__all__.