To Reproduce
I've create a repo that reproduces this issue. It uses this simple code:
class Cls:
def __init__(self, a = 1, b = None):
self.a = a
self.b = b
Note how b has a default value, but that value is None. This is different from an argument that has no default.
To reproduce:
git clone https://github.com/multimeric/StubgenBug
cd StubgenBug/
uv run stubgen --inspect-mode -m tmp_dmnkkm8uuq
cat out/tmp_dmnkkm8uuq/__init__.pyi
Expected Behavior
I would expect b to indicate the default value exists:
class Cls:
def __init__(self, a: int = ..., b = ...) -> None: ...
Actual Behavior
b doesn't have a default:
class Cls:
def __init__(self, a: int = ..., b) -> None: ...
Your Environment
Python 3.12.6
stubgen 1.15.0