Skip to content

Warning does not show the file in which the deprecated key was accessed #13

@NOhs

Description

@NOhs

Currently, the warning presented does not indicate in which file the deprecated key was accessed. It simply states the line in which the warning is called which is within _dkey. It would be better to use the stacklevel for warn to give the proper location.

Current output

some_function()
C:/ .../_dkey.py:498: FutureWarning: Key `13` is deprecated. Use `12` from now on.
  self._warn_deprecation(mapping)

Expected output

some_function()
my_module.py:12: FutureWarning: Key `13` is deprecated. Use `12` from now on.
  my_dict[13]

Tasks

  • Set stacklevel
  • Update gif in readme

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions