enthought / enthought/traitsui

Editor __init__ arguments should be reviewed

Open
#1,703 0 comments 0 reactions 0 assignees View on GitHub
type: discussion type: refactor
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

There are a number of issues with the arguments that are passed to the `Editor.__init__` method.

- the `parent` argument is never used (instead it is passed to the `prepare` method later)
- the `tooltip` argument probably shouldn't be _required_
- the `item` possibly _should_ be passed (except it isn't available in all cases where an editor is created, eg. by a `TableEditor`)
- the `item` is currently only used for button editors (to get the button label if one isn't supplied) and by the wx editors to determine sizing behaviour
- we should probably require as few positional arguments as possible and move to keyword-only

All-in-all this probably needs a redesign, but very carefully, as we are talking public parts of the APIs.

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.