Let's get the formalities out of the way:  This is about Python 2.7.x running on Windows 7.
I'm creating a subclass of the Tkinter listbox widget, and one of the things I need the subclass to provide is a property containing the index (line number) of the line that is currently active (i.e. has the focus).  I know that Tkinter supports the constant tk.ACTIVE for all listbox methods that take an index, but in my custom widget this property needs to always be an integer, never a string.
I've scoured the documents but there doesn't seem to be method that will return the index of the active line, nor a way to "convert" tk.ACTIVE to its effective index number.  Methods like curselection() or selection_includes() are not helpful because this listbox is always going to have a selectmode of tk.EXTENDED -- which means any number of lines may be selected and further that the current active line may or may not be among them.
I considered using an event binding to wait for arrow keys, mouse clicks, etc. and look for changes to the curselection() tuple, but this is not quite helpful or straightforward either.  E.g. suppose the user shift-clicks to select a range -- he may go top-to-bottom or bottom-to-top, and either way the tuple will just show the range, not which line is active.
So then: is there any way at all (overt or sneaky, simple or complex) to get the equivalent index number for the tk.ACTIVE line?
The way to get the line number of the active line of the listbox is to use the index method: listbox.index(tk.ACTIVE).
"Convert" tk.ACTIVE to the index (line number) in a listbox