Skip to content

Commit

Permalink
primitives: improve deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Oct 1, 2024
1 parent 363eafa commit 03ceaa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pymbolic/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,8 @@ def {cls.__name__}_hash(self):
def {cls.__name__}_init_arg_names(self):
depr_key = (type(self), "init_arg_names")
if depr_key not in self._deprecation_warnings_issued:
warn("__getinitargs__ is deprecated and will be removed in 2025. "
"Use dataclasses.fields instead.",
warn("Attribute 'init_arg_names' of {cls} is deprecated and will "
"be removed in 2025. Use dataclasses.fields instead.",
DeprecationWarning, stacklevel=2)
self._deprecation_warnings_issued.add(depr_key)
Expand All @@ -913,8 +913,8 @@ def {cls.__name__}_init_arg_names(self):
def {cls.__name__}_getinitargs(self):
depr_key = (type(self), "__getinitargs__")
if depr_key not in self._deprecation_warnings_issued:
warn("__getinitargs__ is deprecated and will be removed in 2025. "
"Use dataclasses.fields instead.",
warn("Method '__getinitargs__' of {cls} is deprecated and will "
"be removed in 2025. Use dataclasses.fields instead.",
DeprecationWarning, stacklevel=2)
self._deprecation_warnings_issued.add(depr_key)
Expand Down

0 comments on commit 03ceaa1

Please sign in to comment.