bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (#3667)

Defer removing old behavior to 3.8.
Document new feature of selection_set() and friends.
This commit is contained in:
Serhiy Storchaka 2017-09-24 14:34:09 +03:00 committed by GitHub
parent c247caf33f
commit 2fad102354
3 changed files with 23 additions and 7 deletions

View file

@ -1404,13 +1404,13 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
import warnings
warnings.warn(
"The selop=None argument of selection() is deprecated "
"and will be removed in Python 3.7",
"and will be removed in Python 3.8",
DeprecationWarning, 3)
elif selop in ('set', 'add', 'remove', 'toggle'):
import warnings
warnings.warn(
"The selop argument of selection() is deprecated "
"and will be removed in Python 3.7, "
"and will be removed in Python 3.8, "
"use selection_%s() instead" % (selop,),
DeprecationWarning, 3)
else: