mirror of
https://github.com/ModOrganizer2/pystubs-generation.git
synced 2026-07-27 14:07:13 -07:00
Fix missing optional annotation in some cases.
This commit is contained in:
@@ -108,9 +108,12 @@ def parse_python_signature(s: str, name: str) -> tuple[PyType, list[Argument]]:
|
||||
raise ValueError(f"invalid argument: {pa}, {s}")
|
||||
|
||||
matches = m.groupdict()
|
||||
arguments.append(
|
||||
Argument(matches["name"], PyType(matches["type"]), matches["value"])
|
||||
)
|
||||
type_ = matches["type"]
|
||||
if matches["value"] == "None":
|
||||
if "None" not in type_ and "MoVariant" not in type_:
|
||||
type_ = type_ + " | None"
|
||||
|
||||
arguments.append(Argument(matches["name"], PyType(type_), matches["value"]))
|
||||
|
||||
return PyType(return_type), arguments
|
||||
|
||||
|
||||
@@ -1639,7 +1639,7 @@ class IModList:
|
||||
"""
|
||||
...
|
||||
def allModsByProfilePriority(
|
||||
self: IModList, profile: IProfile = None
|
||||
self: IModList, profile: IProfile | None = None
|
||||
) -> Sequence[str]:
|
||||
"""
|
||||
Returns:
|
||||
@@ -3818,7 +3818,7 @@ class ISaveGameInfoWidget(PyQt6.QtWidgets.QWidget):
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self: ISaveGameInfoWidget, parent: PyQt6.QtWidgets.QWidget = None
|
||||
self: ISaveGameInfoWidget, parent: PyQt6.QtWidgets.QWidget | None = None
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
|
||||
@@ -15,7 +15,7 @@ class TaskDialog:
|
||||
|
||||
def __init__(
|
||||
self: TaskDialog,
|
||||
parent: PyQt6.QtWidgets.QWidget = None,
|
||||
parent: PyQt6.QtWidgets.QWidget | None = None,
|
||||
title: str = "",
|
||||
main: str = "",
|
||||
content: str = "",
|
||||
|
||||
Reference in New Issue
Block a user