Overload read and blocks functions and methods#484
Conversation
|
I'm still thinking about this issue, and am still very torn about it. Could you demonstrate how this changes your IDE behavior, or point me to a video where some other project shows similar behavior? |
Yes, I happen to be refactoring my universal In case these are helpful, the screenshots show files in these exact commits:
Current overloads
Giga overloads
|
|
Thank you very much for providing these examples! This helps me understand what this is trying to achieve. In your first example, the return type of Just to be clear, this is not a criticism of your examples. I merely want to understand how this stuff is used in practice. |





NDArraytype for compact typing of indeterminate axes._2d_float64TypeAlias, and three more, for compact typing of 2-axis ndarray.T_ndarrayTypeVar foroutparameter because the ndarray assigned tooutis the return type.kwargs_readTypedDict for parameters afterout: see notes below.Generatortype, remove the optionalNonevalues.sound, to help the static type checkers.outoverload is first because it's different, but maybe it should be last.Unpack
If
**kwargs: Unpack...were in the primary definition, the parameters in the typed dict would be keyword-only, of course. In the overload definitions, if a user wants to ensure they have the benefit of a static type checker, then they will need to treat some of the parameters in most of the overload definitions are keyword-only, including those inUnpack.I didn't add
Unpackto the overload definition that contains the default values for dtype, always_2d, and out. Therefore, for the default case, for the static type checkers, all parameters are positional-or-keyword. After explaining my "reason", the idea sounds pretty stupid.