Skip to content

gh-82665 Mention that HTMLParser.handle_starttag value can be None#134312

Open
Fearless-Badger wants to merge 5 commits intopython:mainfrom
Fearless-Badger:main
Open

gh-82665 Mention that HTMLParser.handle_starttag value can be None#134312
Fearless-Badger wants to merge 5 commits intopython:mainfrom
Fearless-Badger:main

Conversation

@Fearless-Badger
Copy link
Copy Markdown

@Fearless-Badger Fearless-Badger commented May 20, 2025

This change adds documentation that specifies the behavior of HTMLParser.handle_starttag when a boolean attribute is parsed.

Since there is no value for the standard "key - value" format, "None" is placed into the tuple as the corresponding value for the boolean attribute.


📚 Documentation preview 📚: https://cpython-previews--134312.org.readthedocs.build/en/134312/library/html.parser.html

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 20, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

This comment was marked as outdated.

@emmatyping emmatyping added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 20, 2025
Comment thread Doc/library/html.parser.rst Outdated
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 25, 2026
Comment thread Doc/library/html.parser.rst Outdated
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Comment thread Doc/library/html.parser.rst Outdated
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

I really like the new example. Because <input> has many boolean attributes and because <script> has its own quirks unrelated to the example.

@ezio-melotti ezio-melotti self-assigned this Apr 26, 2026
@ezio-melotti ezio-melotti removed the stale Stale PR or inactive for long period of time. label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants