enthought / enthought/traits

remove_trait()'s behavior on non-dynamically added traits is undocumented and poorly defined

Open
#1,423 0 comments 0 reactions 0 assignees View on GitHub
component: core type: bug
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

`remove_trait()` is supposed to be used for traits that were added via `add_trait()`, however this is neither specified in the docstring

https://github.com/enthought/traits/blob/eb0027f3d6a57968104949e5a5fc5d7db9d4a577/traits/has_traits.py#L2842-L2854

or elsewhere in the documentation, nor enforced in the code.

As a result, `remove_trait()` can be performed with a "static" trait, in which case it erases the trait's value, keeps the trait, and returns `False`. This behavior should probably be reconsidered or documented.

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.