Skip to content

Commit

Permalink
remove deprecation warning of Val (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipVinc committed Sep 1, 2023
1 parent a0f59d6 commit 297a098
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plum/parametric.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from typing import Union

import beartype.door
Expand Down Expand Up @@ -371,11 +370,12 @@ def __init__(self, val=None):
Args:
val (object): The value to be moved to the type domain.
"""
warnings.warn(
"`plum.Val` is deprecated and will be removed in a future version. "
"Please use `typing.Literal` instead.",
stacklevel=2,
)
# Do not deprecate until beartype#276 is solved
# warnings.warn(
# "`plum.Val` is deprecated and will be removed in a future version. "
# "Please use `typing.Literal` instead.",
# stacklevel=2,
# )
if type(self).concrete:
if val is not None and type_parameter(self) != val:
raise ValueError("The value must be equal to the type parameter.")
Expand Down

0 comments on commit 297a098

Please sign in to comment.