Skip to content

Commit e5a01ea

Browse files
committed
Change match to fullmatch
1 parent 52eba1b commit e5a01ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/batgrl/colors/color_types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727

2828

2929
def validate_hexcode(hexcode: Hexcode) -> bool:
30-
return bool(_HEXCODE_RE.match(hexcode))
30+
return _HEXCODE_RE.fullmatch(hexcode) is not None
3131

3232

3333
def validate_ahexcode(ahexcode: AHexcode) -> bool:
34-
return validate_hexcode(ahexcode) or bool(_AHEXCODE_RE.match(ahexcode))
34+
if validate_hexcode(ahexcode):
35+
return True
36+
return _AHEXCODE_RE.fullmatch(ahexcode) is not None
3537

3638

3739
def _to_hex(channel: int):

0 commit comments

Comments
 (0)