dependabot[bot] opened a new pull request, #3868: URL: https://github.com/apache/avro/pull/3868
Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/python/mypy/blob/master/CHANGELOG.md">mypy's changelog</a>.</em></p> <blockquote> <h1>Mypy Release Notes</h1> <h2>Next Release</h2> <h2>Mypy 2.2</h2> <p>We've just uploaded mypy 2.2.0 to the Python Package Index (<a href="https://pypi.org/project/mypy/">PyPI</a>). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:</p> <pre><code>python3 -m pip install -U mypy </code></pre> <p>You can read the full documentation for this release on <a href="http://mypy.readthedocs.io">Read the Docs</a>.</p> <h3>Support for Closed TypedDicts (PEP 728)</h3> <p>Mypy now supports closed TypedDicts as specified in PEP 728. A closed TypedDict cannot have extra keys beyond those explicitly defined. This allows the type checker to determine that certain operations are safe when they otherwise wouldn't be due to the potential presence of unknown keys.</p> <p>You can use the <code>closed</code> keyword argument with <code>TypedDict</code>:</p> <pre lang="python"><code>HasName = TypedDict("HasName", {"name": str}) HasOnlyName = TypedDict("HasOnlyName", {"name": str}, closed=True) Movie = TypedDict("Movie", {"name": str, "year": int}) <p>movie: Movie = {"name": "Nimona", "year": 2023} has_name: HasName = movie # OK: HasName is open (default) has_only_name: HasOnlyName = movie # Error: HasOnlyName is closed and Movie has extra "year" key </code></pre></p> <p>Closed TypedDicts enable more precise type checking because the type checker knows exactly which keys are present. This is particularly useful when working with TypedDict unions or when you want to ensure that a TypedDict conforms to an exact shape.</p> <p>The <code>closed</code> keyword also enables safe type narrowing with <code>in</code> checks:</p> <pre lang="python"><code>Book = TypedDict('Book', {'book': str}, closed=True) DVD = TypedDict('DVD', {'dvd': str}, closed=True) type Inventory = Book | DVD <p>def print_type(inventory: Inventory) -> None: if "book" in inventory: # Type is narrowed to Book here - safe because DVD is closed print(inventory["book"]) else: # Type is narrowed to DVD here print(inventory["dvd"]) </tr></table> </code></pre></p> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/b3c4a5b93adb49f979ab553fffebae7179cefa74"><code>b3c4a5b</code></a> Mark release</li> <li><a href="https://github.com/python/mypy/commit/396f5082ac677a5115fbd6a0122328a6711f73dd"><code>396f508</code></a> [Chore] Update changelog for 2.2 (<a href="https://redirect.github.com/python/mypy/issues/21691">#21691</a>)</li> <li><a href="https://github.com/python/mypy/commit/9592a9ea65a9502b14ac3094b28f9e0e3a2e500a"><code>9592a9e</code></a> Upload wasm wheels to PyPI (<a href="https://redirect.github.com/python/mypy/issues/21671">#21671</a>)</li> <li><a href="https://github.com/python/mypy/commit/1dc69620d9e827b015e6486114e0aaff7ec2d990"><code>1dc6962</code></a> Bump ast-serialize to 0.6.0 (<a href="https://redirect.github.com/python/mypy/issues/21664">#21664</a>)</li> <li><a href="https://github.com/python/mypy/commit/96a791310d47575827e44d10360505d8e23807b0"><code>96a7913</code></a> Bump librt to 0.12.0 (<a href="https://redirect.github.com/python/mypy/issues/21663">#21663</a>)</li> <li><a href="https://github.com/python/mypy/commit/5ef090270579013c337a9bcc79e2c58417f09538"><code>5ef0902</code></a> Fix the exportjson tool (.ff cache to .json conversion) (<a href="https://redirect.github.com/python/mypy/issues/21628">#21628</a>)</li> <li><a href="https://github.com/python/mypy/commit/8d621adb954731ba76b25bf7130275f3cadbb81a"><code>8d621ad</code></a> Support --shadow-file with --native-parser (<a href="https://redirect.github.com/python/mypy/issues/21623">#21623</a>)</li> <li><a href="https://github.com/python/mypy/commit/74ecdd8ecc9bee271eab49948436af63751ed1ff"><code>74ecdd8</code></a> Sync typeshed (<a href="https://redirect.github.com/python/mypy/issues/21612">#21612</a>)</li> <li><a href="https://github.com/python/mypy/commit/0cd154158ab2829a2f8c7a2728c7d4ed55e8f193"><code>0cd1541</code></a> [mypyc] Make function wrappers thread-safe on free-threaded builds (<a href="https://redirect.github.com/python/mypy/issues/21620">#21620</a>)</li> <li><a href="https://github.com/python/mypy/commit/22a9cfd1595798810e27ef145ea4c989ccdcc883"><code>22a9cfd</code></a> [mypyc] Make list remove and index thread-safe on free-threaded builds (<a href="https://redirect.github.com/python/mypy/issues/21614">#21614</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v0.1.0...v2.2.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
