Feature or enhancement
The Tk text widget supports the pathName edit canundo and pathName edit canredo subcommands, which report whether the undo and redo stacks are non-empty. tkinter currently wraps edit modified, edit redo, edit reset, edit separator and edit undo, but not edit canundo/edit canredo. They are only reachable through the generic, undocumented Text.edit() passthrough.
I propose adding two convenience methods to tkinter.Text:
edit_canundo()โ returnTrueif undo is possible (the undo stack is not empty),Falseotherwise.edit_canredo()โ returnTrueif redo is possible (the redo stack is not empty),Falseotherwise.
Both return a proper bool.
Links to previous discussion
This is one of a few Tk text subcommands not yet wrapped by tkinter; sync/pendingsync are tracked separately.