Skip to content

Conversation

@stefan6419846
Copy link
Collaborator

Having the parameter typed as a dictionary does not allow for stricter type hints on the user side, like dict[str, str], as a dictionary is considered mutable. Typing our method as Mapping indicates that we do not change the corresponding values inside it and does allow for stricter typing in user code.

Closes #3453.

…ld_values

Having the parameter typed as a dictionary does not allow for stricter
type hints on the user side, like `dict[str, str]`, as a dictionary is
considered mutable. Typing our method as `Mapping` indicates that we
do not change the corresponding values inside it and does allow for
stricter typing in user code.

Closes py-pdf#3453.
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (2b2eca2) to head (1e818e2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3490   +/-   ##
=======================================
  Coverage   97.09%   97.09%           
=======================================
  Files          56       56           
  Lines        9658     9658           
  Branches     1748     1748           
=======================================
  Hits         9377     9377           
  Misses        168      168           
  Partials      113      113           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 merged commit 9fad9ff into py-pdf:main Oct 6, 2025
16 checks passed
@stefan6419846 stefan6419846 deleted the issue3453 branch October 6, 2025 12:07
stefan6419846 added a commit that referenced this pull request Oct 19, 2025
## What's new

### Bug Fixes (BUG)
- Fix handling of zero-length StreamObject (#3485) by @Likend

### Robustness (ROB)
- Deal with wrong size for incremental PDF files (#3495) by @stefan6419846
- Improve handling for malformed cross-reference tables (#3483) by @stefan6419846

### Developer Experience (DEV)
- Use released Python 3.14 by @stefan6419846
- Use Mapping instead of dict in type hint of update_page_form_field_values (#3490) by @stefan6419846

[Full Changelog](6.1.1...6.1.2)
OpenNingia pushed a commit to OpenNingia/pypdf that referenced this pull request Oct 23, 2025
…ld_values (py-pdf#3490)

Having the parameter typed as a dictionary does not allow for stricter
type hints on the user side, like `dict[str, str]`, as a dictionary is
considered mutable. Typing our method as `Mapping` indicates that we
do not change the corresponding values inside it and does allow for
stricter typing in user code.

Closes py-pdf#3453.
OpenNingia pushed a commit to OpenNingia/pypdf that referenced this pull request Oct 23, 2025
## What's new

### Bug Fixes (BUG)
- Fix handling of zero-length StreamObject (py-pdf#3485) by @Likend

### Robustness (ROB)
- Deal with wrong size for incremental PDF files (py-pdf#3495) by @stefan6419846
- Improve handling for malformed cross-reference tables (py-pdf#3483) by @stefan6419846

### Developer Experience (DEV)
- Use released Python 3.14 by @stefan6419846
- Use Mapping instead of dict in type hint of update_page_form_field_values (py-pdf#3490) by @stefan6419846

[Full Changelog](py-pdf/pypdf@6.1.1...6.1.2)
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.

Change dict to mapping in writer.update_page_form_field_values

1 participant