enthought / enthought/traitsui

False positives for traitsui.editors DeprecationWarning

Open
#2,047 0 comments 0 reactions 0 assignees View on GitHub
difficulty: easy type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

There's currently a `DeprecationWarning` issued if one tries to import editors from `traitsui.editors` instead of from `traitsui.editors.api`. However, the criterion for issuing the warning is a little too broad: the check is `if name in traitsui.editors.api.__dict__`, and this picks up things like the `__warningsregistry__` attribute. This results in the warning being issued unexpectedly (e.g., as a result of the warnings machinery accessing the `traitsui.editors.__warningsregistry`).

This may be a use-case for adding an `__all__` to `traits.editors.api`. Or we could tighten up the check.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.