classification
Title: tkinter messagebox is sloppy
Type: enhancement Stage:
Components: Documentation, Tests Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: David Lambert, docs@python, serhiy.storchaka
Priority: normal Keywords:

Created on 2019-10-30 19:37 by David Lambert, last changed 2020-12-25 21:56 by serhiy.storchaka.

Messages (4)
msg355729 - (view) Author: David Lambert (David Lambert) Date: 2019-10-30 19:37
Does aksokcancel return "true" or True ?  The docstring should say True   This is pervasive throughout the module.  tkinter has such a mishmash of numbers supplied as strings, strings supplied as constants making this carelessness egregious.  On the topic of constants, the messagebox module redefines OK.  You might argue that the definition didn't change.  I suspect this issue applies to all versions of tkinter or Tkinter having the messagebox.

# types
ABORTRETRYIGNORE = "abortretryignore"
OK = "ok"
...

# replies
...
OK = "ok"



def askokcancel(title=None, message=None, **options):
    "Ask if operation should proceed; return true if the answer is ok"
    s = _show(title, message, QUESTION, OKCANCEL, **options)
    return s == OK
msg355762 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2019-10-31 17:14
Please note that calling something "sloppy" and that somehow its development was done in some "carelessness" fashion to the point of being "egregious" is not motivating to others to try and help. Trying to support all of this code for free in one's spare time is not easy, so I would ask you try to be more understanding and nicer in your comments.
msg360092 - (view) Author: David Lambert (David Lambert) Date: 2020-01-16 01:27
Sometimes I say nice things about python.

https://www.quora.com/Is-Python-fast-yet/answer/David-Lambert-86?__nsrc__=4&__snid3__=6376944631

On 10/31/19 1:14 PM, Brett Cannon wrote:
> Brett Cannon <brett@python.org> added the comment:
>
> Please note that calling something "sloppy" and that somehow its development was done in some "carelessness" fashion to the point of being "egregious" is not motivating to others to try and help. Trying to support all of this code for free in one's spare time is not easy, so I would ask you try to be more understanding and nicer in your comments.
>
> ----------
> nosy: +brett.cannon
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue38649>
> _______________________________________
msg383769 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-12-25 21:56
I agree that there is a problem. tkinter.messagebox is poorly documented. Different functions can return True, False, None or the name of the button, and it is not specified which function what returns. Set of acceptable values for type and icon are not documented. And there are no tests, so we cannot be sure that all works as expected on all platforms.

I am working on it.
History
Date User Action Args
2020-12-25 21:56:35serhiy.storchakasetversions: + Python 3.10, - Python 3.6
nosy: + serhiy.storchaka

messages: + msg383769

assignee: docs@python -> serhiy.storchaka
components: + Tests
2020-01-16 01:27:02David Lambertsetmessages: + msg360092
2019-11-27 18:42:19brett.cannonsetnosy: - brett.cannon
2019-10-31 17:14:52brett.cannonsetnosy: + brett.cannon
messages: + msg355762
2019-10-30 19:37:05David Lambertcreate