python / cpython

The Python programming language
https://www.python.org
Other
62.34k stars 29.94k forks source link

Documentation-Tkinter Clarify module spelling change in Python 3 docs #69362

Closed cdb766b8-ff78-44de-9f9a-ee273b22ae10 closed 8 years ago

cdb766b8-ff78-44de-9f9a-ee273b22ae10 commented 9 years ago
BPO 25175
Nosy @terryjreedy, @vadmium, @willingc, @bharel
Files
  • Issue25175.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['easy', 'invalid', 'type-feature', 'expert-tkinter', 'docs'] title = 'Documentation-Tkinter Clarify module spelling change in Python 3 docs' updated_at = user = 'https://bugs.python.org/RishitBansal' ``` bugs.python.org fields: ```python activity = actor = 'terry.reedy' assignee = 'docs@python' closed = True closed_date = closer = 'terry.reedy' components = ['Documentation', 'Tkinter'] creation = creator = 'Rishit Bansal' dependencies = [] files = ['40520'] hgrepos = [] issue_num = 25175 keywords = ['patch', 'easy'] message_count = 10.0 messages = ['251070', '251071', '251079', '251109', '251121', '251131', '251134', '251135', '251615', '252314'] nosy_count = 7.0 nosy_names = ['terry.reedy', 'docs@python', 'BreamoreBoy', 'martin.panter', 'willingc', 'bar.harel', 'Rishit Bansal'] pr_nums = [] priority = 'normal' resolution = 'not a bug' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue25175' versions = ['Python 3.4', 'Python 3.5', 'Python 3.6'] ```

    cdb766b8-ff78-44de-9f9a-ee273b22ae10 commented 9 years ago

    The statement required to check whether Tkinter is installed on a system is mentioned in the documentation as python -m tkinter , whereas it is supposed to be python -m Tkinter (with a big 't'). Please correct this error on the documentation here:https://docs.python.org/3/library/tkinter.html as it is very misleading to beginners.

    vadmium commented 9 years ago

    The problem here is you have quoted the Python 3 documentation (see in the title, or the version switcher at the top), when you are presumably using Python 2. The module changed name to lowercase in Python 3.

    willingc commented 9 years ago

    Although the documentation for Python 3 and Python 2 is correct as Martin shared, adding a note about capitalization in the Python 3 docs would be helpful for beginners for two reasons: 1) the name of the Tkinter project does start with a capital 'T' and 2) the python module name changed from Python 2 to 3.

    Adding a note that the spelling of the module changed in version 3 to 'tkinter' from version 2's 'Tkinter' would be helpful for new users (especially since Tkinter is often used in educational applications).

    I have updated the issue title, issue type, stage, and keywords to reflect that this issue is not a documentation error but a helpful, user friendly documentation enhancement.

    9326c04b-4d37-4a35-bdd5-d40f5f681a02 commented 9 years ago

    Is this good? :-)

    vadmium commented 9 years ago

    Normally the documentation doesn’t mention changes from Python 2. But in this case one often has to rely on other sources of documentation, which are often about Python 2, so I think the notice might be reasonable.

    83d2e70e-e599-4a04-b820-3814bbdb9bef commented 9 years ago

    Does this open a can of worms? "You did it for Tkinter, why not do it for everything that was changed by PEP-3108"?

    vadmium commented 9 years ago

    Perhaps it would be better to add the notice inside the big “See also” box at the top. In particular I occasionally find myself looking at the NMT “Tkinter reference: a GUI for Python” and Effbot sites as a substitute for the missing built-in documentation, and both these are written for Python 2. On the other hand, the TkDocs site is also useful, and seem to use Python 3.

    willingc commented 9 years ago

    Thank you Bar Harel for submitting a patch.

    Ultimately, I believe that the wording should be what is most helpful for the end users.

    If you wish to avoid mentioning Python 2, then a simple note cautioning the user to take care that the case of the module should match the user's Python version.

    "Note: Python 3 uses all lowercase for the 'tkinter' module. Earlier versions of Python used 'Tkinter'. Please take care to use the correct module name that corresponds to the Python version being used."

    terryjreedy commented 8 years ago

    Martin> Normally the documentation doesn’t mention changes from Python 2

    Right: forward notes in 2.7 doc, no backward notes in 3.x doc. The 2.7 doc has near the top "Note: Tkinter has been renamed to tkinter in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3." Perhaps this should be expanded to mention the other tkinter imports.

    We collectively agreed that adding backward notes in 3.x docs is not needed for beginners who start with 3.x, and would actively confuse them with information most do not need. I think breaking this rule requires agreement of more than the nosy list here: at minimum, Georg Brandl and Serhiy Storchaka, but better pydev.

    There are still occasional issues about removing 2.x mentions or, more likely now, revising leftover 2.x examples. The OP is complaining about an example that was properly revised. If a new 2.x note were added, someone might come along and remove it.

    I agree with Mark> Does this open a can of worms? Just for tkinter, there is also "import tkFont" (2.x) versus "import tkinter.font" (3.x) and similar for other stuff in the 'tkinter' package. Consequently, the proposed note is incomplete.

    Carol> the Tkinter project does start with a capital 'T' I am not aware of a 'Tkinter project' separate from the tkinter module in the stdlib, maintained by various people, though current mostly by Serhiy. In any case, the Python project starts with 'P' while the python binaries start with 'p'.

    The OP simply made a mistake; there is no bug in the 3.x doc. The tkinter package (unlike idlelib) follows 3.x rules. I think the issue should have been closed immediately as 'not a bug', and should be so closed now.

    9326c04b-4d37-4a35-bdd5-d40f5f681a02 commented 8 years ago

    I guess you're correct, a simple mistake one time mistake shouldn't require the changing of the docs.