python / python/cpython

Tutorial - Section 4 Has Numerous Problems

Open
#119,997 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

Remember, the target audience for the tutorial are people with no prior Python knowledge. Given this, there are a few problems:

  • Section 4.2: The second code example uses dictionaries but they have not been introduced - and they appear again in a bullet point in Section 4.6.
  • Section 4.2: (Same code example.) Furthermore, while users and users.copy() might make some intuitive sense, a brief explanation of what items() does seems necessary, otherwise people will think "I guess I just have to write this even though I have no idea why".
  • Section 4.6: __match_args__ is poorly introduced. It is explained that if it's set a certain way, it's possible to write patterns in a certain way but it's not made clear how to set it until the following example, which is about nesting patterns. This might lead readers to get stuck before it's even clarified.
  • Section 4.6: It seems like some of the bullet points at the end of this section were written in a rush, assume prior knowledge of Python, and do not follow the pace of the tutorial. (We've had a bunch of questions on Discord from people who essentially didn't understand anything that was written there.)

It seems like a lot of this has been copied over almost verbatim from PEP-636, which shares the same problems.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading tutorial Sections 4.2 and 4.6, then compare the related material in PEP-636. Check that dictionaries and items() are introduced before use, that match_args is explained before its pattern syntax, and that the closing bullet points work for readers with no prior Python knowledge. Done means these sections are understandable without the Discord questions described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.