Author serhiy.storchaka
Recipients serhiy.storchaka, terry.reedy
Date 2016-06-14.17:40:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
For now methods selection_set(), selection_add(), selection_remove() and selection_toggle() of ttk.TreeView take the single argument that should be either the single item id or a tuple or list of item ids. In contrary methods delete() and detach() take item ids as a variable number of arguments. The latter interface looks more pythonic, more consistent and errorproof.

Proposed patch (based on Terry's suggestion in issue26386) makes selection methods accepting a variable number of arguments. For compatibility with older versions a tuple or list of item ids can be specified as a single argument, but this interface is deprecated (with long deprecation period).

In addition deprecated other weird interface. For now the selection() method can take a subcommand name and items, for example tv.selection('add', 'ITEM1'). If the first argument is None, arguments are ignored, tv.selection(None, 'spam') equals to tv.selection(). Now all this is deprecated and will be TypeError in 3.7.
Date User Action Args
2016-06-14 17:41:00serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy
2016-06-14 17:41:00serhiy.storchakasetmessageid: <>
2016-06-14 17:41:00serhiy.storchakalinkissue27319 messages
2016-06-14 17:40:59serhiy.storchakacreate