mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Update the cheatsheet for functions and keyword argument typing

Open franekmagiera opened this issue 2 years ago • 4 comments

PEP 692 has been accepted and issue #4441 is fixed - added an entry to the cheatsheet mentioning a new way of annotating **kwargs in a function signature.

franekmagiera avatar May 01 '23 17:05 franekmagiera

I don't think mypy enables PEP 692 by default yet, so maybe we should do that first?

JelleZijlstra avatar May 01 '23 21:05 JelleZijlstra

Thanks for the comments. I added the section to the TypedDict docs, also updated the section on mixing required and not required items.

As for enabling Unpack - good point! Let's park the doc update for a while. I will try to go through the PEP 692 and see if its specification is enforced by mypy or if we're still missing something and create a separate PR for that. I'm going mountain hiking for a few days, will try to pick that up when I come back.

franekmagiera avatar May 02 '23 17:05 franekmagiera

Hey, sorry for no updates on this (the weather was too nice not to go outside). I started working on enabling the Unpack feature by default, just want to make sure that all the examples from PEP 692 are in the test suite and are passing. Hope to find some time to work on this over the weekend.

franekmagiera avatar Jun 08 '23 08:06 franekmagiera

I've opened another PR https://github.com/python/mypy/pull/15612 that's adding tests from PEP 692, still have trouble with:

franekmagiera avatar Jul 06 '23 19:07 franekmagiera