Handle arg=<sentinel value> in stubgenc by generating an ellipsis default annotated as Incomplete - #22019
Handle arg=<sentinel value> in stubgenc by generating an ellipsis default annotated as Incomplete#22019edgarrmondragon wants to merge 3 commits into
Incomplete#22019Conversation
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
9afa235 to
45e6b87
Compare
Incomplete
JelleZijlstra
left a comment
There was a problem hiding this comment.
This is only stubgenc, should we do something similar for regular stubgen?
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
It seems that it's handled by stubgenc in the Lines 1811 to 1820 in dc8858f I've added both a |
|
@JukkaL @p-sawicki It looks like |
| [out] | ||
| from _typeshed import Incomplete | ||
|
|
||
| def f(x: Incomplete = ...): ... |
There was a problem hiding this comment.
I feel ideally we should generate a stub for the sentinel here and annotate the parameter as Incomplete | _MISSING.
mypy was generating stubs like
def test(self, arg0: sentinel = ...) -> None: ..., where thesentinelannotation isn't really helpful.Related:
sentineldefaults, but notobject()markers #22013 (comment)