Skip to content

fix: add type hints for encoding parameter in parser_tools#1399

Merged
stevepiercy merged 6 commits into
collective:mainfrom
cybs-joe:fix/add-type-hints-encoding
May 23, 2026
Merged

fix: add type hints for encoding parameter in parser_tools#1399
stevepiercy merged 6 commits into
collective:mainfrom
cybs-joe:fix/add-type-hints-encoding

Conversation

@cybs-joe
Copy link
Copy Markdown
Contributor

@cybs-joe cybs-joe commented May 22, 2026

Added 'str' type hint to the encoding parameter in from_unicode, to_unicode, and data_encode functions.

Used Claude (claude-sonnet-4-6) to identify untyped parameters and suggest the fix. Reviewed and validated all changes manually.

Refs issue 938

Description

Added str type hint to the encoding parameter in from_unicode,
to_unicode, and data_encode in src/icalendar/parser_tools.py.

Checklist

  • I've added a change log entry to /news, following the instructions in Change log entry format.
  • I've added or updated tests if applicable.
  • I've run and ensured all tests pass locally by following Run tests.
  • I've added or edited documentation, both as docstrings to be rendered in the API documentation and narrative documentation, as necessary.

Additional information

Upload screenshots, videos, links to documentation, or any other relevant information.


📚 Documentation preview 📚: https://icalendar--1399.org.readthedocs.build/

cybs-joe added 2 commits May 22, 2026 23:45
Added 'str' type hint to the encoding parameter in from_unicode,
to_unicode, and data_encode functions.

Used Claude (claude-sonnet-4-6) to identify untyped parameters and
suggest the fix. Reviewed and validated all changes manually.
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 22, 2026

angatha
angatha previously approved these changes May 23, 2026
Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

This is good.

My suggestion adds markup to show that it's an inline literal. With that change, it can be merged.

Thank you!

Comment thread news/938.documentation Outdated
@stevepiercy stevepiercy enabled auto-merge (squash) May 23, 2026 08:59
@stevepiercy
Copy link
Copy Markdown
Member

@cybs-joe would you please edit the description from Closes to Refs? We don't want to close that issue when this PR is merged, as there are many more places to add type hints. Thank you!

@stevepiercy stevepiercy disabled auto-merge May 23, 2026 09:01
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@cybs-joe cybs-joe requested a review from stevepiercy May 23, 2026 09:59
Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Thank you!

@stevepiercy stevepiercy enabled auto-merge (squash) May 23, 2026 10:22
@stevepiercy stevepiercy merged commit 143ab65 into collective:main May 23, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants