From 03e095c09856b85083ce0882a1bfd364c5bb2271 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 14 Aug 2026 11:12:35 +0200 Subject: [PATCH 1/4] Mark positional-only parameters in the IcePy stub and docstrings The IcePy stub declared ordinary, keyword-capable parameters for almost every function, but the C functions behind them are registered METH_VARARGS (or METH_O) and parse with PyArg_ParseTuple, so they accept positional arguments only. Type checkers therefore accepted calls such as connection.setAdapter(adapter=None) that raise TypeError at runtime. The constructors are worse: their tp_init ignores the keyword dict, so IcePy.Properties(args=[...]) silently dropped the argument. Add a '/' marker to every affected declaration in the stub, and add the same marker to the signature line of the corresponding IcePy docstrings, which must match the stub (checkIcePyStub.py) and feed the Sphinx API reference. ice_invoke and ice_invokeAsync are registered with METH_KEYWORDS and genuinely accept keyword arguments; they are unchanged. Fixes #6442 --- changelog.d/python/6442.md | 3 + python/modules/IcePy/Communicator.cpp | 40 ++-- python/modules/IcePy/Connection.cpp | 13 +- python/modules/IcePy/ImplicitContext.cpp | 10 +- python/modules/IcePy/Init.cpp | 30 +-- python/modules/IcePy/Logger.cpp | 13 +- python/modules/IcePy/ObjectAdapter.cpp | 48 ++--- python/modules/IcePy/Operation.cpp | 13 +- python/modules/IcePy/Properties.cpp | 28 +-- python/modules/IcePy/PropertiesAdmin.cpp | 4 +- python/modules/IcePy/Proxy.cpp | 34 ++-- python/python/IcePy-stubs/__init__.pyi | 238 +++++++++++------------ 12 files changed, 240 insertions(+), 234 deletions(-) create mode 100644 changelog.d/python/6442.md diff --git a/changelog.d/python/6442.md b/changelog.d/python/6442.md new file mode 100644 index 00000000000..936ba249f67 --- /dev/null +++ b/changelog.d/python/6442.md @@ -0,0 +1,3 @@ +- Fixed the IcePy stub declaring keyword-capable parameters for functions that accept positional arguments only. + Type checkers accepted calls such as `connection.setAdapter(adapter=None)` that raise `TypeError` at runtime; + the stub and the docstrings now mark these parameters positional-only. diff --git a/python/modules/IcePy/Communicator.cpp b/python/modules/IcePy/Communicator.cpp index a5e3cef8c15..7f395a63e7a 100644 --- a/python/modules/IcePy/Communicator.cpp +++ b/python/modules/IcePy/Communicator.cpp @@ -1409,12 +1409,12 @@ static PyMethodDef CommunicatorMethods[] = { {"destroyAsync", reinterpret_cast(communicatorDestroyAsync), METH_VARARGS, - PyDoc_STR("destroyAsync(callable: Callable) -> None")}, + PyDoc_STR("destroyAsync(callable: Callable, /) -> None")}, {"shutdown", reinterpret_cast(communicatorShutdown), METH_NOARGS, PyDoc_STR("shutdown() -> None")}, {"waitForShutdown", reinterpret_cast(communicatorWaitForShutdown), METH_VARARGS, - PyDoc_STR("waitForShutdown(timeout: int) -> bool")}, + PyDoc_STR("waitForShutdown(timeout: int, /) -> bool")}, {"shutdownCompleted", reinterpret_cast(communicatorShutdownCompleted), METH_NOARGS, @@ -1426,35 +1426,35 @@ static PyMethodDef CommunicatorMethods[] = { {"stringToProxy", reinterpret_cast(communicatorStringToProxy), METH_VARARGS, - PyDoc_STR("stringToProxy(str: str) -> Ice.ObjectPrx | None")}, + PyDoc_STR("stringToProxy(str: str, /) -> Ice.ObjectPrx | None")}, {"proxyToString", reinterpret_cast(communicatorProxyToString), METH_VARARGS, - PyDoc_STR("proxyToString(proxy: Ice.ObjectPrx | None) -> str")}, + PyDoc_STR("proxyToString(proxy: Ice.ObjectPrx | None, /) -> str")}, {"propertyToProxy", reinterpret_cast(communicatorPropertyToProxy), METH_VARARGS, - PyDoc_STR("propertyToProxy(property: str) -> Ice.ObjectPrx | None")}, + PyDoc_STR("propertyToProxy(property: str, /) -> Ice.ObjectPrx | None")}, {"proxyToProperty", reinterpret_cast(communicatorProxyToProperty), METH_VARARGS, - PyDoc_STR("proxyToProperty(proxy: Ice.ObjectPrx, property: str) -> dict[str, str]")}, + PyDoc_STR("proxyToProperty(proxy: Ice.ObjectPrx, property: str, /) -> dict[str, str]")}, {"identityToString", reinterpret_cast(communicatorIdentityToString), METH_VARARGS, - PyDoc_STR("identityToString(identity: Ice.Identity) -> str")}, + PyDoc_STR("identityToString(identity: Ice.Identity, /) -> str")}, {"createObjectAdapter", reinterpret_cast(communicatorCreateObjectAdapter), METH_VARARGS, - PyDoc_STR("createObjectAdapter(name: str) -> ObjectAdapter")}, + PyDoc_STR("createObjectAdapter(name: str, /) -> ObjectAdapter")}, {"createObjectAdapterWithEndpoints", reinterpret_cast(communicatorCreateObjectAdapterWithEndpoints), METH_VARARGS, - PyDoc_STR("createObjectAdapterWithEndpoints(name: str, endpoints: str) -> ObjectAdapter")}, + PyDoc_STR("createObjectAdapterWithEndpoints(name: str, endpoints: str, /) -> ObjectAdapter")}, {"createObjectAdapterWithRouter", reinterpret_cast(communicatorCreateObjectAdapterWithRouter), METH_VARARGS, - PyDoc_STR("createObjectAdapterWithRouter(name: str, router: Ice.RouterPrx) -> ObjectAdapter")}, + PyDoc_STR("createObjectAdapterWithRouter(name: str, router: Ice.RouterPrx, /) -> ObjectAdapter")}, {"getDefaultObjectAdapter", reinterpret_cast(communicatorGetDefaultObjectAdapter), METH_NOARGS, @@ -1462,7 +1462,7 @@ static PyMethodDef CommunicatorMethods[] = { {"setDefaultObjectAdapter", reinterpret_cast(communicatorSetDefaultObjectAdapter), METH_VARARGS, - PyDoc_STR("setDefaultObjectAdapter(adapter: Ice.ObjectAdapter | None) -> None")}, + PyDoc_STR("setDefaultObjectAdapter(adapter: Ice.ObjectAdapter | None, /) -> None")}, {"getImplicitContext", reinterpret_cast(communicatorGetImplicitContext), METH_NOARGS, @@ -1482,7 +1482,7 @@ static PyMethodDef CommunicatorMethods[] = { {"setDefaultRouter", reinterpret_cast(communicatorSetDefaultRouter), METH_VARARGS, - PyDoc_STR("setDefaultRouter(router: Ice.RouterPrx | None) -> None")}, + PyDoc_STR("setDefaultRouter(router: Ice.RouterPrx | None, /) -> None")}, {"getDefaultLocator", reinterpret_cast(communicatorGetDefaultLocator), METH_NOARGS, @@ -1490,19 +1490,19 @@ static PyMethodDef CommunicatorMethods[] = { {"setDefaultLocator", reinterpret_cast(communicatorSetDefaultLocator), METH_VARARGS, - PyDoc_STR("setDefaultLocator(locator: Ice.LocatorPrx | None) -> None")}, + PyDoc_STR("setDefaultLocator(locator: Ice.LocatorPrx | None, /) -> None")}, {"flushBatchRequests", reinterpret_cast(communicatorFlushBatchRequests), METH_VARARGS, - PyDoc_STR("flushBatchRequests(compress: Ice.CompressBatch) -> None")}, + PyDoc_STR("flushBatchRequests(compress: Ice.CompressBatch, /) -> None")}, {"flushBatchRequestsAsync", reinterpret_cast(communicatorFlushBatchRequestsAsync), METH_VARARGS, - PyDoc_STR("flushBatchRequestsAsync(compress: Ice.CompressBatch) -> Awaitable[None]")}, + PyDoc_STR("flushBatchRequestsAsync(compress: Ice.CompressBatch, /) -> Awaitable[None]")}, {"createAdmin", reinterpret_cast(communicatorCreateAdmin), METH_VARARGS, - PyDoc_STR("createAdmin(adminAdapter: Ice.ObjectAdapter | None, adminIdentity: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("createAdmin(adminAdapter: Ice.ObjectAdapter | None, adminIdentity: Ice.Identity, /) -> Ice.ObjectPrx")}, {"getAdmin", reinterpret_cast(communicatorGetAdmin), METH_NOARGS, @@ -1510,11 +1510,11 @@ static PyMethodDef CommunicatorMethods[] = { {"addAdminFacet", reinterpret_cast(communicatorAddAdminFacet), METH_VARARGS, - PyDoc_STR("addAdminFacet(servant: Ice.Object, facet: str) -> None")}, + PyDoc_STR("addAdminFacet(servant: Ice.Object, facet: str, /) -> None")}, {"findAdminFacet", reinterpret_cast(communicatorFindAdminFacet), METH_VARARGS, - PyDoc_STR("findAdminFacet(facet: str) -> Ice.Object | NativePropertiesAdmin | None")}, + PyDoc_STR("findAdminFacet(facet: str, /) -> Ice.Object | NativePropertiesAdmin | None")}, {"findAllAdminFacets", reinterpret_cast(communicatorFindAllAdminFacets), METH_NOARGS, @@ -1522,11 +1522,11 @@ static PyMethodDef CommunicatorMethods[] = { {"removeAdminFacet", reinterpret_cast(communicatorRemoveAdminFacet), METH_VARARGS, - PyDoc_STR("removeAdminFacet(facet: str) -> Ice.Object | None")}, + PyDoc_STR("removeAdminFacet(facet: str, /) -> Ice.Object | None")}, {"_setWrapper", reinterpret_cast(communicatorSetWrapper), METH_VARARGS, - PyDoc_STR("_setWrapper(wrapper: Ice.Communicator) -> None")}, + PyDoc_STR("_setWrapper(wrapper: Ice.Communicator, /) -> None")}, {"_getWrapper", reinterpret_cast(communicatorGetWrapper), METH_NOARGS, diff --git a/python/modules/IcePy/Connection.cpp b/python/modules/IcePy/Connection.cpp index d502950f106..f862ef4dae4 100644 --- a/python/modules/IcePy/Connection.cpp +++ b/python/modules/IcePy/Connection.cpp @@ -68,7 +68,7 @@ Awaitable[None] A future that becomes available when the connection is closed. If the connection was lost or aborted, awaiting this future raises the exception that caused the connection's closure.)"; - constexpr const char* connectionCreateProxy_doc = R"(createProxy(identity: Ice.Identity) -> Ice.ObjectPrx + constexpr const char* connectionCreateProxy_doc = R"(createProxy(identity: Ice.Identity, /) -> Ice.ObjectPrx Creates a special proxy (a 'fixed proxy') that always uses this connection. @@ -94,7 +94,7 @@ Disables the inactivity check on this connection. By default, Ice will close connections that remain inactive for a certain period. This function disables that behavior for this connection.)"; - constexpr const char* connectionSetAdapter_doc = R"(setAdapter(adapter: Ice.ObjectAdapter | None) -> None + constexpr const char* connectionSetAdapter_doc = R"(setAdapter(adapter: Ice.ObjectAdapter | None, /) -> None Associates an object adapter with this connection. @@ -125,7 +125,8 @@ Returns Ice.ObjectAdapter | None The object adapter associated with this connection.)"; - constexpr const char* connectionFlushBatchRequests_doc = R"(flushBatchRequests(compress: Ice.CompressBatch) -> None + constexpr const char* connectionFlushBatchRequests_doc = + R"(flushBatchRequests(compress: Ice.CompressBatch, /) -> None Flushes any pending batch requests for this connection. @@ -143,7 +144,7 @@ LocalException has been destroyed.)"; constexpr const char* connectionFlushBatchRequestsAsync_doc = - R"(flushBatchRequestsAsync(compress: Ice.CompressBatch) -> Awaitable[None] + R"(flushBatchRequestsAsync(compress: Ice.CompressBatch, /) -> Awaitable[None] Flushes any pending batch requests for this connection asynchronously. @@ -165,7 +166,7 @@ CommunicatorDestroyedException If the communicator has been destroyed. This exception is raised synchronously.)"; constexpr const char* connectionSetCloseCallback_doc = - R"(setCloseCallback(callback: Callable[[Connection], None] | None) -> None + R"(setCloseCallback(callback: Callable[[Connection], None] | None, /) -> None Sets a close callback on the connection. The callback is called by the connection when it's closed. The callback is called from the Ice thread pool associated with the connection. @@ -215,7 +216,7 @@ Returns Ice.Endpoint The endpoint from which the connection was created.)"; - constexpr const char* connectionSetBufferSize_doc = R"(setBufferSize(rcvSize: int, sndSize: int) -> None + constexpr const char* connectionSetBufferSize_doc = R"(setBufferSize(rcvSize: int, sndSize: int, /) -> None Sets the size of the receive and send buffers. diff --git a/python/modules/IcePy/ImplicitContext.cpp b/python/modules/IcePy/ImplicitContext.cpp index ad40985695b..60289e82f4f 100644 --- a/python/modules/IcePy/ImplicitContext.cpp +++ b/python/modules/IcePy/ImplicitContext.cpp @@ -252,20 +252,20 @@ static PyMethodDef ImplicitContextMethods[] = { {"setContext", reinterpret_cast(implicitContextSetContext), METH_VARARGS, - PyDoc_STR("setContext(newContext: dict[str, str]) -> None")}, + PyDoc_STR("setContext(newContext: dict[str, str], /) -> None")}, {"containsKey", reinterpret_cast(implicitContextContainsKey), METH_VARARGS, - PyDoc_STR("containsKey(key: str) -> bool")}, - {"get", reinterpret_cast(implicitContextGet), METH_VARARGS, PyDoc_STR("get(key: str) -> str")}, + PyDoc_STR("containsKey(key: str, /) -> bool")}, + {"get", reinterpret_cast(implicitContextGet), METH_VARARGS, PyDoc_STR("get(key: str, /) -> str")}, {"put", reinterpret_cast(implicitContextPut), METH_VARARGS, - PyDoc_STR("put(key: str, value: str) -> str")}, + PyDoc_STR("put(key: str, value: str, /) -> str")}, {"remove", reinterpret_cast(implicitContextRemove), METH_VARARGS, - PyDoc_STR("remove(key: str) -> str")}, + PyDoc_STR("remove(key: str, /) -> str")}, {} /* sentinel */ }; diff --git a/python/modules/IcePy/Init.cpp b/python/modules/IcePy/Init.cpp index 1c63d768add..de0a010755f 100644 --- a/python/modules/IcePy/Init.cpp +++ b/python/modules/IcePy/Init.cpp @@ -50,7 +50,7 @@ int The Ice version.)"; constexpr const char* IcePy_createProperties_doc = - R"(createProperties(args: list[str] | None = None, defaults: Ice.Properties | None = None) -> Properties + R"(createProperties(args: list[str] | None = None, defaults: Ice.Properties | None = None, /) -> Properties Creates a property set initialized from command-line arguments and a default property set. @@ -66,7 +66,7 @@ Returns Properties A new property set.)"; - constexpr const char* IcePy_stringToIdentity_doc = R"(stringToIdentity(str: str) -> Ice.Identity + constexpr const char* IcePy_stringToIdentity_doc = R"(stringToIdentity(str: str, /) -> Ice.Identity Converts a stringified identity into an Identity. @@ -88,7 +88,7 @@ LocalException If the resulting identity has an empty name.)"; constexpr const char* IcePy_identityToString_doc = - R"(identityToString(identity: Ice.Identity, toStringMode: Ice.ToStringMode | None = None) -> str + R"(identityToString(identity: Ice.Identity, toStringMode: Ice.ToStringMode | None = None, /) -> str Converts an Identity into a string using the specified mode. @@ -114,7 +114,7 @@ Returns Ice.Logger | Logger The current per-process logger instance.)"; - constexpr const char* IcePy_setProcessLogger_doc = R"(setProcessLogger(logger: Ice.Logger) -> None + constexpr const char* IcePy_setProcessLogger_doc = R"(setProcessLogger(logger: Ice.Logger, /) -> None Sets the per-process logger. Communicators created after this call use this logger unless a logger is set in InitializationData or configured through logger properties such as Ice.LogFile. @@ -124,7 +124,7 @@ Parameters logger : Ice.Logger The new per-process logger instance.)"; - constexpr const char* IcePy_loadSlice_doc = R"(loadSlice(args: list[str]) -> None + constexpr const char* IcePy_loadSlice_doc = R"(loadSlice(args: list[str], /) -> None Compiles Slice definitions and loads the generated code directly into the current Python environment. @@ -158,7 +158,7 @@ Raises RuntimeError If an error occurs during Slice parsing or compilation.)"; - constexpr const char* IcePy_compileSlice_doc = R"(compileSlice(args: list[str]) -> int + constexpr const char* IcePy_compileSlice_doc = R"(compileSlice(args: list[str], /) -> int Compiles Slice definitions. The behavior is identical to that of the `slice2py` compiler. @@ -208,41 +208,41 @@ static PyMethodDef methods[] = { {"defineEnum", reinterpret_cast(IcePy_defineEnum), METH_VARARGS, - PyDoc_STR("defineEnum(sliceId: str, type: Type, meta: tuple, enumerators: dict)")}, + PyDoc_STR("defineEnum(sliceId: str, type: Type, meta: tuple, enumerators: dict, /)")}, {"defineStruct", reinterpret_cast(IcePy_defineStruct), METH_VARARGS, - PyDoc_STR("defineStruct(sliceId: str, type: Type, meta: tuple, members: tuple)")}, + PyDoc_STR("defineStruct(sliceId: str, type: Type, meta: tuple, members: tuple, /)")}, {"defineSequence", reinterpret_cast(IcePy_defineSequence), METH_VARARGS, - PyDoc_STR("defineSequence(sliceId: str, meta: tuple, elementType: TypeInfo)")}, + PyDoc_STR("defineSequence(sliceId: str, meta: tuple, elementType: TypeInfo, /)")}, {"defineDictionary", reinterpret_cast(IcePy_defineDictionary), METH_VARARGS, - PyDoc_STR("defineDictionary(sliceId: str, meta: tuple, keyType: TypeInfo, valueType: TypeInfo)")}, + PyDoc_STR("defineDictionary(sliceId: str, meta: tuple, keyType: TypeInfo, valueType: TypeInfo, /)")}, {"declareProxy", reinterpret_cast(IcePy_declareProxy), METH_VARARGS, - PyDoc_STR("declareProxy(sliceId: str)")}, + PyDoc_STR("declareProxy(sliceId: str, /)")}, {"defineProxy", reinterpret_cast(IcePy_defineProxy), METH_VARARGS, - PyDoc_STR("defineProxy(sliceId: str, proxyType: Type[ObjectPrx])")}, + PyDoc_STR("defineProxy(sliceId: str, proxyType: Type[ObjectPrx], /)")}, {"declareValue", reinterpret_cast(IcePy_declareValue), METH_VARARGS, - PyDoc_STR("declareValue(sliceId: str)")}, + PyDoc_STR("declareValue(sliceId: str, /)")}, {"defineValue", reinterpret_cast(IcePy_defineValue), METH_VARARGS, PyDoc_STR("defineValue(sliceId: str, valueType: Type[Ice.Value], compactId: int, meta: tuple, isInterface: bool, " - "baseType: Type[Ice.Value] | None, members: tuple)")}, + "baseType: Type[Ice.Value] | None, members: tuple, /)")}, {"defineException", reinterpret_cast(IcePy_defineException), METH_VARARGS, PyDoc_STR("defineException(sliceId: str, type: Type[BaseException], meta: tuple, base: Type[BaseException] | " - "None, members: tuple)")}, + "None, members: tuple, /)")}, {"loadSlice", reinterpret_cast(IcePy_loadSlice), METH_VARARGS, PyDoc_STR(IcePy_loadSlice_doc)}, {"compileSlice", reinterpret_cast(IcePy_compileSlice), diff --git a/python/modules/IcePy/Logger.cpp b/python/modules/IcePy/Logger.cpp index 6e30b3104d7..c70c532e813 100644 --- a/python/modules/IcePy/Logger.cpp +++ b/python/modules/IcePy/Logger.cpp @@ -310,18 +310,21 @@ loggerCloneWithPrefix(LoggerObject* self, PyObject* args) } static PyMethodDef LoggerMethods[] = { - {"print", reinterpret_cast(loggerPrint), METH_VARARGS, PyDoc_STR("print(message: str) -> None")}, + {"print", reinterpret_cast(loggerPrint), METH_VARARGS, PyDoc_STR("print(message: str, /) -> None")}, {"trace", reinterpret_cast(loggerTrace), METH_VARARGS, - PyDoc_STR("trace(category: str, message: str) -> None")}, - {"warning", reinterpret_cast(loggerWarning), METH_VARARGS, PyDoc_STR("warning(message: str) -> None")}, - {"error", reinterpret_cast(loggerError), METH_VARARGS, PyDoc_STR("error(message: str) -> None")}, + PyDoc_STR("trace(category: str, message: str, /) -> None")}, + {"warning", + reinterpret_cast(loggerWarning), + METH_VARARGS, + PyDoc_STR("warning(message: str, /) -> None")}, + {"error", reinterpret_cast(loggerError), METH_VARARGS, PyDoc_STR("error(message: str, /) -> None")}, {"getPrefix", reinterpret_cast(loggerGetPrefix), METH_NOARGS, PyDoc_STR("getPrefix() -> str")}, {"cloneWithPrefix", reinterpret_cast(loggerCloneWithPrefix), METH_VARARGS, - PyDoc_STR("cloneWithPrefix(prefix: str) -> Logger")}, + PyDoc_STR("cloneWithPrefix(prefix: str, /) -> Logger")}, {} /* sentinel */ }; diff --git a/python/modules/IcePy/ObjectAdapter.cpp b/python/modules/IcePy/ObjectAdapter.cpp index a3238127670..975303f7780 100644 --- a/python/modules/IcePy/ObjectAdapter.cpp +++ b/python/modules/IcePy/ObjectAdapter.cpp @@ -1460,12 +1460,12 @@ static PyMethodDef AdapterMethods[] = { {"waitForHold", reinterpret_cast(adapterWaitForHold), METH_VARARGS, - PyDoc_STR("waitForHold(timeout: int) -> bool")}, + PyDoc_STR("waitForHold(timeout: int, /) -> bool")}, {"deactivate", reinterpret_cast(adapterDeactivate), METH_NOARGS, PyDoc_STR("deactivate() -> None")}, {"waitForDeactivate", reinterpret_cast(adapterWaitForDeactivate), METH_VARARGS, - PyDoc_STR("waitForDeactivate(timeout: int) -> bool")}, + PyDoc_STR("waitForDeactivate(timeout: int, /) -> bool")}, {"isDeactivated", reinterpret_cast(adapterIsDeactivated), METH_NOARGS, @@ -1474,87 +1474,87 @@ static PyMethodDef AdapterMethods[] = { {"add", reinterpret_cast(adapterAdd), METH_VARARGS, - PyDoc_STR("add(servant: Ice.Object, id: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("add(servant: Ice.Object, id: Ice.Identity, /) -> Ice.ObjectPrx")}, {"addFacet", reinterpret_cast(adapterAddFacet), METH_VARARGS, - PyDoc_STR("addFacet(servant: Ice.Object, id: Ice.Identity, facet: str) -> Ice.ObjectPrx")}, + PyDoc_STR("addFacet(servant: Ice.Object, id: Ice.Identity, facet: str, /) -> Ice.ObjectPrx")}, {"addWithUUID", reinterpret_cast(adapterAddWithUUID), METH_VARARGS, - PyDoc_STR("addWithUUID(servant: Ice.Object) -> Ice.ObjectPrx")}, + PyDoc_STR("addWithUUID(servant: Ice.Object, /) -> Ice.ObjectPrx")}, {"addFacetWithUUID", reinterpret_cast(adapterAddFacetWithUUID), METH_VARARGS, - PyDoc_STR("addFacetWithUUID(servant: Ice.Object, facet: str) -> Ice.ObjectPrx")}, + PyDoc_STR("addFacetWithUUID(servant: Ice.Object, facet: str, /) -> Ice.ObjectPrx")}, {"addDefaultServant", reinterpret_cast(adapterAddDefaultServant), METH_VARARGS, - PyDoc_STR("addDefaultServant(servant: Ice.Object, category: str) -> None")}, + PyDoc_STR("addDefaultServant(servant: Ice.Object, category: str, /) -> None")}, {"remove", reinterpret_cast(adapterRemove), METH_VARARGS, - PyDoc_STR("remove(id: Ice.Identity) -> Ice.Object")}, + PyDoc_STR("remove(id: Ice.Identity, /) -> Ice.Object")}, {"removeFacet", reinterpret_cast(adapterRemoveFacet), METH_VARARGS, - PyDoc_STR("removeFacet(id: Ice.Identity, facet: str) -> Ice.Object")}, + PyDoc_STR("removeFacet(id: Ice.Identity, facet: str, /) -> Ice.Object")}, {"removeAllFacets", reinterpret_cast(adapterRemoveAllFacets), METH_VARARGS, - PyDoc_STR("removeAllFacets(id: Ice.Identity) -> dict[str, Ice.Object]")}, + PyDoc_STR("removeAllFacets(id: Ice.Identity, /) -> dict[str, Ice.Object]")}, {"removeDefaultServant", reinterpret_cast(adapterRemoveDefaultServant), METH_VARARGS, - PyDoc_STR("removeDefaultServant(category: str) -> Ice.Object")}, + PyDoc_STR("removeDefaultServant(category: str, /) -> Ice.Object")}, {"find", reinterpret_cast(adapterFind), METH_VARARGS, - PyDoc_STR("find(identity: Ice.Identity) -> Ice.Object | None")}, + PyDoc_STR("find(identity: Ice.Identity, /) -> Ice.Object | None")}, {"findFacet", reinterpret_cast(adapterFindFacet), METH_VARARGS, - PyDoc_STR("findFacet(id: Ice.Identity, facet: str) -> Ice.Object | None")}, + PyDoc_STR("findFacet(id: Ice.Identity, facet: str, /) -> Ice.Object | None")}, {"findAllFacets", reinterpret_cast(adapterFindAllFacets), METH_VARARGS, - PyDoc_STR("findAllFacets(id: Ice.Identity) -> dict[str, Ice.Object]")}, + PyDoc_STR("findAllFacets(id: Ice.Identity, /) -> dict[str, Ice.Object]")}, {"findByProxy", reinterpret_cast(adapterFindByProxy), METH_VARARGS, - PyDoc_STR("findByProxy(proxy: Ice.ObjectPrx) -> Ice.Object | None")}, + PyDoc_STR("findByProxy(proxy: Ice.ObjectPrx, /) -> Ice.Object | None")}, {"findDefaultServant", reinterpret_cast(adapterFindDefaultServant), METH_VARARGS, - PyDoc_STR("findDefaultServant(category: str) -> Ice.Object | None")}, + PyDoc_STR("findDefaultServant(category: str, /) -> Ice.Object | None")}, {"addServantLocator", reinterpret_cast(adapterAddServantLocator), METH_VARARGS, - PyDoc_STR("addServantLocator(locator: Ice.ServantLocator, category: str) -> None")}, + PyDoc_STR("addServantLocator(locator: Ice.ServantLocator, category: str, /) -> None")}, {"removeServantLocator", reinterpret_cast(adapterRemoveServantLocator), METH_VARARGS, - PyDoc_STR("removeServantLocator(category: str) -> Ice.ServantLocator")}, + PyDoc_STR("removeServantLocator(category: str, /) -> Ice.ServantLocator")}, {"findServantLocator", reinterpret_cast(adapterFindServantLocator), METH_VARARGS, - PyDoc_STR("findServantLocator(category: str) -> Ice.ServantLocator | None")}, + PyDoc_STR("findServantLocator(category: str, /) -> Ice.ServantLocator | None")}, {"createProxy", reinterpret_cast(adapterCreateProxy), METH_VARARGS, - PyDoc_STR("createProxy(identity: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("createProxy(identity: Ice.Identity, /) -> Ice.ObjectPrx")}, {"createDirectProxy", reinterpret_cast(adapterCreateDirectProxy), METH_VARARGS, - PyDoc_STR("createDirectProxy(identity: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("createDirectProxy(identity: Ice.Identity, /) -> Ice.ObjectPrx")}, {"createIndirectProxy", reinterpret_cast(adapterCreateIndirectProxy), METH_VARARGS, - PyDoc_STR("createIndirectProxy(identity: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("createIndirectProxy(identity: Ice.Identity, /) -> Ice.ObjectPrx")}, {"setLocator", reinterpret_cast(adapterSetLocator), METH_VARARGS, - PyDoc_STR("setLocator(locator: Ice.LocatorPrx | None) -> None")}, + PyDoc_STR("setLocator(locator: Ice.LocatorPrx | None, /) -> None")}, {"getLocator", reinterpret_cast(adapterGetLocator), METH_NOARGS, @@ -1570,7 +1570,7 @@ static PyMethodDef AdapterMethods[] = { {"setPublishedEndpoints", reinterpret_cast(adapterSetPublishedEndpoints), METH_VARARGS, - PyDoc_STR("setPublishedEndpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) -> None")}, + PyDoc_STR("setPublishedEndpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint], /) -> None")}, {} /* sentinel */ }; diff --git a/python/modules/IcePy/Operation.cpp b/python/modules/IcePy/Operation.cpp index 46cce16948b..8e842e12e52 100644 --- a/python/modules/IcePy/Operation.cpp +++ b/python/modules/IcePy/Operation.cpp @@ -844,12 +844,15 @@ static PyMethodDef OperationMethods[] = { {"invoke", reinterpret_cast(operationInvoke), METH_VARARGS, - PyDoc_STR("invoke(proxy: ObjectPrx, args: tuple) -> Any")}, + PyDoc_STR("invoke(proxy: ObjectPrx, args: tuple, /) -> Any")}, {"invokeAsync", reinterpret_cast(operationInvokeAsync), METH_VARARGS, - PyDoc_STR("invokeAsync(proxy: ObjectPrx, args: tuple) -> Awaitable[Any]")}, - {"deprecate", reinterpret_cast(operationDeprecate), METH_VARARGS, PyDoc_STR("deprecate(reason: str)")}, + PyDoc_STR("invokeAsync(proxy: ObjectPrx, args: tuple, /) -> Awaitable[Any]")}, + {"deprecate", + reinterpret_cast(operationDeprecate), + METH_VARARGS, + PyDoc_STR("deprecate(reason: str, /)")}, {} /* sentinel */ }; @@ -857,11 +860,11 @@ static PyMethodDef DispatchCallbackMethods[] = { {"response", reinterpret_cast(dispatchCallbackResponse), METH_VARARGS, - PyDoc_STR("response(result: Any) -> None")}, + PyDoc_STR("response(result: Any, /) -> None")}, {"exception", reinterpret_cast(dispatchCallbackException), METH_VARARGS, - PyDoc_STR("exception(exception: BaseException) -> None")}, + PyDoc_STR("exception(exception: BaseException, /) -> None")}, {} /* sentinel */ }; diff --git a/python/modules/IcePy/Properties.cpp b/python/modules/IcePy/Properties.cpp index e125f0c02a2..1b113a2f910 100644 --- a/python/modules/IcePy/Properties.cpp +++ b/python/modules/IcePy/Properties.cpp @@ -687,47 +687,47 @@ static PyMethodDef PropertyMethods[] = { {"getProperty", reinterpret_cast(propertiesGetProperty), METH_VARARGS, - PyDoc_STR("getProperty(key: str) -> str")}, + PyDoc_STR("getProperty(key: str, /) -> str")}, {"getIceProperty", reinterpret_cast(propertiesGetIceProperty), METH_VARARGS, - PyDoc_STR("getIceProperty(key: str) -> str")}, + PyDoc_STR("getIceProperty(key: str, /) -> str")}, {"getPropertyWithDefault", reinterpret_cast(propertiesGetPropertyWithDefault), METH_VARARGS, - PyDoc_STR("getPropertyWithDefault(key: str, value: str) -> str")}, + PyDoc_STR("getPropertyWithDefault(key: str, value: str, /) -> str")}, {"getPropertyAsInt", reinterpret_cast(propertiesGetPropertyAsInt), METH_VARARGS, - PyDoc_STR("getPropertyAsInt(key: str) -> int")}, + PyDoc_STR("getPropertyAsInt(key: str, /) -> int")}, {"getIcePropertyAsInt", reinterpret_cast(propertiesGetIcePropertyAsInt), METH_VARARGS, - PyDoc_STR("getIcePropertyAsInt(key: str) -> int")}, + PyDoc_STR("getIcePropertyAsInt(key: str, /) -> int")}, {"getPropertyAsIntWithDefault", reinterpret_cast(propertiesGetPropertyAsIntWithDefault), METH_VARARGS, - PyDoc_STR("getPropertyAsIntWithDefault(key: str, value: int) -> int")}, + PyDoc_STR("getPropertyAsIntWithDefault(key: str, value: int, /) -> int")}, {"getPropertyAsList", reinterpret_cast(propertiesGetPropertyAsList), METH_VARARGS, - PyDoc_STR("getPropertyAsList(key: str) -> list[str]")}, + PyDoc_STR("getPropertyAsList(key: str, /) -> list[str]")}, {"getIcePropertyAsList", reinterpret_cast(propertiesGetIcePropertyAsList), METH_VARARGS, - PyDoc_STR("getIcePropertyAsList(key: str) -> list[str]")}, + PyDoc_STR("getIcePropertyAsList(key: str, /) -> list[str]")}, {"getPropertyAsListWithDefault", reinterpret_cast(propertiesGetPropertyAsListWithDefault), METH_VARARGS, - PyDoc_STR("getPropertyAsListWithDefault(key: str, value: list[str]) -> list[str]")}, + PyDoc_STR("getPropertyAsListWithDefault(key: str, value: list[str], /) -> list[str]")}, {"getPropertiesForPrefix", reinterpret_cast(propertiesGetPropertiesForPrefix), METH_VARARGS, - PyDoc_STR("getPropertiesForPrefix(prefix: str) -> dict[str, str]")}, + PyDoc_STR("getPropertiesForPrefix(prefix: str, /) -> dict[str, str]")}, {"setProperty", reinterpret_cast(propertiesSetProperty), METH_VARARGS, - PyDoc_STR("setProperty(key: str, value: str) -> None")}, + PyDoc_STR("setProperty(key: str, value: str, /) -> None")}, {"getCommandLineOptions", reinterpret_cast(propertiesGetCommandLineOptions), METH_NOARGS, @@ -735,12 +735,12 @@ static PyMethodDef PropertyMethods[] = { {"parseCommandLineOptions", reinterpret_cast(propertiesParseCommandLineOptions), METH_VARARGS, - PyDoc_STR("parseCommandLineOptions(prefix: str, options: list[str]) -> list[str]")}, + PyDoc_STR("parseCommandLineOptions(prefix: str, options: list[str], /) -> list[str]")}, {"parseIceCommandLineOptions", reinterpret_cast(propertiesParseIceCommandLineOptions), METH_VARARGS, - PyDoc_STR("parseIceCommandLineOptions(options: list[str]) -> list[str]")}, - {"load", reinterpret_cast(propertiesLoad), METH_VARARGS, PyDoc_STR("load(file: str) -> None")}, + PyDoc_STR("parseIceCommandLineOptions(options: list[str], /) -> list[str]")}, + {"load", reinterpret_cast(propertiesLoad), METH_VARARGS, PyDoc_STR("load(file: str, /) -> None")}, {"clone", reinterpret_cast(propertiesClone), METH_NOARGS, PyDoc_STR("clone() -> Properties")}, {} /* sentinel */ }; diff --git a/python/modules/IcePy/PropertiesAdmin.cpp b/python/modules/IcePy/PropertiesAdmin.cpp index 7f4bb5bf50b..3ffb335eb31 100644 --- a/python/modules/IcePy/PropertiesAdmin.cpp +++ b/python/modules/IcePy/PropertiesAdmin.cpp @@ -13,7 +13,7 @@ using namespace IcePy; namespace { constexpr const char* nativePropertiesAdminAddUpdateCB_doc = - R"(addUpdateCallback(callback: Callable[[dict[str, str]], None]) -> None + R"(addUpdateCallback(callback: Callable[[dict[str, str]], None], /) -> None Registers an update callback that will be invoked when a property update occurs. @@ -23,7 +23,7 @@ callback : Callable[[dict[str, str]], None] The callback.)"; constexpr const char* nativePropertiesAdminRemoveUpdateCB_doc = - R"(removeUpdateCallback(callback: Callable[[dict[str, str]], None]) -> None + R"(removeUpdateCallback(callback: Callable[[dict[str, str]], None], /) -> None Removes a previously registered update callback. diff --git a/python/modules/IcePy/Proxy.cpp b/python/modules/IcePy/Proxy.cpp index a83fabc76cf..6c47d0ea612 100644 --- a/python/modules/IcePy/Proxy.cpp +++ b/python/modules/IcePy/Proxy.cpp @@ -1257,7 +1257,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_identity", reinterpret_cast(proxyIceIdentity), METH_VARARGS, - PyDoc_STR("ice_identity(newIdentity: Ice.Identity) -> Ice.ObjectPrx")}, + PyDoc_STR("ice_identity(newIdentity: Ice.Identity, /) -> Ice.ObjectPrx")}, {"ice_getContext", reinterpret_cast(proxyIceGetContext), METH_NOARGS, @@ -1265,12 +1265,12 @@ static PyMethodDef ProxyMethods[] = { {"ice_context", reinterpret_cast(proxyIceContext), METH_VARARGS, - PyDoc_STR("ice_context(new_context: dict[str, str]) -> Self")}, + PyDoc_STR("ice_context(new_context: dict[str, str], /) -> Self")}, {"ice_getFacet", reinterpret_cast(proxyIceGetFacet), METH_NOARGS, PyDoc_STR("ice_getFacet() -> str")}, {"ice_facet", reinterpret_cast(proxyIceFacet), METH_VARARGS, - PyDoc_STR("ice_facet(new_facet: str) -> Ice.ObjectPrx")}, + PyDoc_STR("ice_facet(new_facet: str, /) -> Ice.ObjectPrx")}, {"ice_getAdapterId", reinterpret_cast(proxyIceGetAdapterId), METH_NOARGS, @@ -1278,7 +1278,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_adapterId", reinterpret_cast(proxyIceAdapterId), METH_VARARGS, - PyDoc_STR("ice_adapterId(newAdapterId: str) -> Self")}, + PyDoc_STR("ice_adapterId(newAdapterId: str, /) -> Self")}, {"ice_getEndpoints", reinterpret_cast(proxyIceGetEndpoints), METH_NOARGS, @@ -1286,7 +1286,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_endpoints", reinterpret_cast(proxyIceEndpoints), METH_VARARGS, - PyDoc_STR("ice_endpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) -> Self")}, + PyDoc_STR("ice_endpoints(newEndpoints: tuple[Endpoint, ...] | list[Endpoint], /) -> Self")}, {"ice_getLocatorCacheTimeout", reinterpret_cast(proxyIceGetLocatorCacheTimeout), METH_NOARGS, @@ -1306,15 +1306,15 @@ static PyMethodDef ProxyMethods[] = { {"ice_collocationOptimized", reinterpret_cast(proxyIceCollocationOptimized), METH_VARARGS, - PyDoc_STR("ice_collocationOptimized(collocated: bool) -> Self")}, + PyDoc_STR("ice_collocationOptimized(collocated: bool, /) -> Self")}, {"ice_locatorCacheTimeout", reinterpret_cast(proxyIceLocatorCacheTimeout), METH_VARARGS, - PyDoc_STR("ice_locatorCacheTimeout(timeout: int) -> Self")}, + PyDoc_STR("ice_locatorCacheTimeout(timeout: int, /) -> Self")}, {"ice_invocationTimeout", reinterpret_cast(proxyIceInvocationTimeout), METH_VARARGS, - PyDoc_STR("ice_invocationTimeout(timeout: int) -> Self")}, + PyDoc_STR("ice_invocationTimeout(timeout: int, /) -> Self")}, {"ice_isConnectionCached", reinterpret_cast(proxyIceIsConnectionCached), METH_NOARGS, @@ -1322,7 +1322,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_connectionCached", reinterpret_cast(proxyIceConnectionCached), METH_VARARGS, - PyDoc_STR("ice_connectionCached(newCache: bool) -> Self")}, + PyDoc_STR("ice_connectionCached(newCache: bool, /) -> Self")}, {"ice_getEndpointSelection", reinterpret_cast(proxyIceGetEndpointSelection), METH_NOARGS, @@ -1330,7 +1330,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_endpointSelection", reinterpret_cast(proxyIceEndpointSelection), METH_VARARGS, - PyDoc_STR("ice_endpointSelection(newType: Ice.EndpointSelectionType) -> Self")}, + PyDoc_STR("ice_endpointSelection(newType: Ice.EndpointSelectionType, /) -> Self")}, {"ice_getEncodingVersion", reinterpret_cast(proxyIceGetEncodingVersion), METH_NOARGS, @@ -1338,7 +1338,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_encodingVersion", reinterpret_cast(proxyIceEncodingVersion), METH_VARARGS, - PyDoc_STR("ice_encodingVersion(version: Ice.EncodingVersion) -> Self")}, + PyDoc_STR("ice_encodingVersion(version: Ice.EncodingVersion, /) -> Self")}, {"ice_getRouter", reinterpret_cast(proxyIceGetRouter), METH_NOARGS, @@ -1346,7 +1346,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_router", reinterpret_cast(proxyIceRouter), METH_VARARGS, - PyDoc_STR("ice_router(router: Ice.RouterPrx | None) -> Self")}, + PyDoc_STR("ice_router(router: Ice.RouterPrx | None, /) -> Self")}, {"ice_getLocator", reinterpret_cast(proxyIceGetLocator), METH_NOARGS, @@ -1354,7 +1354,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_locator", reinterpret_cast(proxyIceLocator), METH_VARARGS, - PyDoc_STR("ice_locator(locator: Ice.LocatorPrx | None) -> Self")}, + PyDoc_STR("ice_locator(locator: Ice.LocatorPrx | None, /) -> Self")}, {"ice_twoway", reinterpret_cast(proxyIceTwoway), METH_NOARGS, PyDoc_STR("ice_twoway() -> Self")}, {"ice_isTwoway", reinterpret_cast(proxyIceIsTwoway), METH_NOARGS, PyDoc_STR("ice_isTwoway() -> bool")}, {"ice_oneway", reinterpret_cast(proxyIceOneway), METH_NOARGS, PyDoc_STR("ice_oneway() -> Self")}, @@ -1383,7 +1383,7 @@ static PyMethodDef ProxyMethods[] = { {"ice_compress", reinterpret_cast(proxyIceCompress), METH_VARARGS, - PyDoc_STR("ice_compress(compress: bool) -> Self")}, + PyDoc_STR("ice_compress(compress: bool, /) -> Self")}, {"ice_getCompress", reinterpret_cast(proxyIceGetCompress), METH_VARARGS, @@ -1391,11 +1391,11 @@ static PyMethodDef ProxyMethods[] = { {"ice_connectionId", reinterpret_cast(proxyIceConnectionId), METH_VARARGS, - PyDoc_STR("ice_connectionId(connectionId: str) -> Self")}, + PyDoc_STR("ice_connectionId(connectionId: str, /) -> Self")}, {"ice_fixed", reinterpret_cast(proxyIceFixed), METH_VARARGS, - PyDoc_STR("ice_fixed(connection: Ice.Connection) -> Self")}, + PyDoc_STR("ice_fixed(connection: Ice.Connection, /) -> Self")}, {"ice_isFixed", reinterpret_cast(proxyIceIsFixed), METH_NOARGS, PyDoc_STR("ice_isFixed() -> bool")}, {"ice_getConnection", reinterpret_cast(proxyIceGetConnection), @@ -1430,7 +1430,7 @@ static PyMethodDef ProxyMethods[] = { {"newProxy", reinterpret_cast(proxyNewProxy), METH_VARARGS | METH_STATIC, - PyDoc_STR("newProxy(type: Type[T], proxy: Ice.ObjectPrx) -> T")}, + PyDoc_STR("newProxy(type: Type[T], proxy: Ice.ObjectPrx, /) -> T")}, {} /* sentinel */ }; diff --git a/python/python/IcePy-stubs/__init__.pyi b/python/python/IcePy-stubs/__init__.pyi index d37a5fc1bbb..e3ea0fba493 100644 --- a/python/python/IcePy-stubs/__init__.pyi +++ b/python/python/IcePy-stubs/__init__.pyi @@ -67,20 +67,20 @@ class BatchRequest: ... class Communicator: - def __init__(self, initData: Ice.InitializationData | None) -> None: ... + def __init__(self, initData: Ice.InitializationData | None, /) -> None: ... def _getWrapper(self) -> Ice.Communicator: ... - def _setWrapper(self, wrapper: Ice.Communicator) -> None: ... - def addAdminFacet(self, servant: Ice.Object, facet: str) -> None: ... - def createAdmin(self, adminAdapter: Ice.ObjectAdapter | None, adminIdentity: Ice.Identity) -> Ice.ObjectPrx: ... - def createObjectAdapter(self, name: str) -> ObjectAdapter: ... - def createObjectAdapterWithEndpoints(self, name: str, endpoints: str) -> ObjectAdapter: ... - def createObjectAdapterWithRouter(self, name: str, router: Ice.RouterPrx) -> ObjectAdapter: ... + def _setWrapper(self, wrapper: Ice.Communicator, /) -> None: ... + def addAdminFacet(self, servant: Ice.Object, facet: str, /) -> None: ... + def createAdmin(self, adminAdapter: Ice.ObjectAdapter | None, adminIdentity: Ice.Identity, /) -> Ice.ObjectPrx: ... + def createObjectAdapter(self, name: str, /) -> ObjectAdapter: ... + def createObjectAdapterWithEndpoints(self, name: str, endpoints: str, /) -> ObjectAdapter: ... + def createObjectAdapterWithRouter(self, name: str, router: Ice.RouterPrx, /) -> ObjectAdapter: ... def destroy(self) -> None: ... - def destroyAsync(self, callable: Callable) -> None: ... - def findAdminFacet(self, facet: str) -> Ice.Object | NativePropertiesAdmin | None: ... + def destroyAsync(self, callable: Callable, /) -> None: ... + def findAdminFacet(self, facet: str, /) -> Ice.Object | NativePropertiesAdmin | None: ... def findAllAdminFacets(self) -> dict[str, Ice.Object | NativePropertiesAdmin]: ... - def flushBatchRequests(self, compress: Ice.CompressBatch) -> None: ... - def flushBatchRequestsAsync(self, compress: Ice.CompressBatch) -> Awaitable[None]: ... + def flushBatchRequests(self, compress: Ice.CompressBatch, /) -> None: ... + def flushBatchRequestsAsync(self, compress: Ice.CompressBatch, /) -> Awaitable[None]: ... def getAdmin(self) -> Ice.ObjectPrx | None: ... def getDefaultLocator(self) -> Ice.LocatorPrx | None: ... def getDefaultObjectAdapter(self) -> Ice.ObjectAdapter | None: ... @@ -88,19 +88,19 @@ class Communicator: def getImplicitContext(self) -> ImplicitContext | None: ... def getLogger(self) -> Ice.Logger | Logger: ... def getProperties(self) -> Properties: ... - def identityToString(self, identity: Ice.Identity) -> str: ... + def identityToString(self, identity: Ice.Identity, /) -> str: ... def isShutdown(self) -> bool: ... - def propertyToProxy(self, property: str) -> Ice.ObjectPrx | None: ... - def proxyToProperty(self, proxy: Ice.ObjectPrx, property: str) -> dict[str, str]: ... - def proxyToString(self, proxy: Ice.ObjectPrx | None) -> str: ... - def removeAdminFacet(self, facet: str) -> Ice.Object | None: ... - def setDefaultLocator(self, locator: Ice.LocatorPrx | None) -> None: ... - def setDefaultObjectAdapter(self, adapter: Ice.ObjectAdapter | None) -> None: ... - def setDefaultRouter(self, router: Ice.RouterPrx | None) -> None: ... + def propertyToProxy(self, property: str, /) -> Ice.ObjectPrx | None: ... + def proxyToProperty(self, proxy: Ice.ObjectPrx, property: str, /) -> dict[str, str]: ... + def proxyToString(self, proxy: Ice.ObjectPrx | None, /) -> str: ... + def removeAdminFacet(self, facet: str, /) -> Ice.Object | None: ... + def setDefaultLocator(self, locator: Ice.LocatorPrx | None, /) -> None: ... + def setDefaultObjectAdapter(self, adapter: Ice.ObjectAdapter | None, /) -> None: ... + def setDefaultRouter(self, router: Ice.RouterPrx | None, /) -> None: ... def shutdown(self) -> None: ... def shutdownCompleted(self) -> Awaitable[None]: ... - def stringToProxy(self, str: str) -> Ice.ObjectPrx | None: ... - def waitForShutdown(self, timeout: int) -> bool: ... + def stringToProxy(self, str: str, /) -> Ice.ObjectPrx | None: ... + def waitForShutdown(self, timeout: int, /) -> bool: ... class Connection: """Represents a connection that uses the Ice protocol.""" @@ -121,7 +121,7 @@ class Connection: """ ... - def createProxy(self, identity: Ice.Identity) -> Ice.ObjectPrx: + def createProxy(self, identity: Ice.Identity, /) -> Ice.ObjectPrx: """ Creates a special proxy (a 'fixed proxy') that always uses this connection. @@ -151,7 +151,7 @@ class Connection: """ ... - def setAdapter(self, adapter: Ice.ObjectAdapter | None) -> None: + def setAdapter(self, adapter: Ice.ObjectAdapter | None, /) -> None: """ Associates an object adapter with this connection. @@ -186,7 +186,7 @@ class Connection: """ ... - def flushBatchRequests(self, compress: Ice.CompressBatch) -> None: + def flushBatchRequests(self, compress: Ice.CompressBatch, /) -> None: """ Flushes any pending batch requests for this connection. @@ -205,10 +205,7 @@ class Connection: """ ... - def flushBatchRequestsAsync( - self, - compress: Ice.CompressBatch, - ) -> Awaitable[None]: + def flushBatchRequestsAsync(self, compress: Ice.CompressBatch, /) -> Awaitable[None]: """ Flushes any pending batch requests for this connection asynchronously. @@ -231,7 +228,7 @@ class Connection: """ ... - def setCloseCallback(self, callback: Callable[[Connection], None] | None) -> None: + def setCloseCallback(self, callback: Callable[[Connection], None] | None, /) -> None: """ Sets a close callback on the connection. The callback is called by the connection when it's closed. The callback is called from the Ice thread pool associated with the connection. @@ -291,7 +288,7 @@ class Connection: """ ... - def setBufferSize(self, rcvSize: int, sndSize: int) -> None: + def setBufferSize(self, rcvSize: int, sndSize: int, /) -> None: """ Sets the size of the receive and send buffers. @@ -341,8 +338,8 @@ class ConnectionInfo: """str: The connection ID.""" class DispatchCallback: - def response(self, result: Any) -> None: ... - def exception(self, exception: BaseException) -> None: ... + def response(self, result: Any, /) -> None: ... + def exception(self, exception: BaseException, /) -> None: ... class Endpoint: """ @@ -457,12 +454,12 @@ class IPEndpointInfo(EndpointInfo): """str: The source IP address.""" class ImplicitContext: - def containsKey(self, key: str) -> bool: ... - def get(self, key: str) -> str: ... + def containsKey(self, key: str, /) -> bool: ... + def get(self, key: str, /) -> str: ... def getContext(self) -> dict[str, str]: ... - def put(self, key: str, value: str) -> str: ... - def remove(self, key: str) -> str: ... - def setContext(self, newContext: dict[str, str]) -> None: ... + def put(self, key: str, value: str, /) -> str: ... + def remove(self, key: str, /) -> str: ... + def setContext(self, newContext: dict[str, str], /) -> None: ... def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... def __gt__(self, other: object) -> bool: ... @@ -471,19 +468,19 @@ class ImplicitContext: def __ne__(self, other: object) -> bool: ... class Logger: - def cloneWithPrefix(self, prefix: str) -> Logger: ... - def error(self, message: str) -> None: ... + def cloneWithPrefix(self, prefix: str, /) -> Logger: ... + def error(self, message: str, /) -> None: ... def getPrefix(self) -> str: ... - def print(self, message: str) -> None: ... - def trace(self, category: str, message: str) -> None: ... - def warning(self, message: str) -> None: ... + def print(self, message: str, /) -> None: ... + def trace(self, category: str, message: str, /) -> None: ... + def warning(self, message: str, /) -> None: ... class NativePropertiesAdmin: """ The default implementation of the 'Properties' admin facet. """ - def addUpdateCallback(self, callback: Callable[[dict[str, str]], None]) -> None: + def addUpdateCallback(self, callback: Callable[[dict[str, str]], None], /) -> None: """ Registers an update callback that will be invoked when a property update occurs. @@ -494,7 +491,7 @@ class NativePropertiesAdmin: """ ... - def removeUpdateCallback(self, callback: Callable[[dict[str, str]], None]) -> None: + def removeUpdateCallback(self, callback: Callable[[dict[str, str]], None], /) -> None: """ Removes a previously registered update callback. @@ -507,23 +504,23 @@ class NativePropertiesAdmin: class ObjectAdapter: def activate(self) -> None: ... - def add(self, servant: Ice.Object, id: Ice.Identity) -> Ice.ObjectPrx: ... - def addDefaultServant(self, servant: Ice.Object, category: str) -> None: ... - def addFacet(self, servant: Ice.Object, id: Ice.Identity, facet: str) -> Ice.ObjectPrx: ... - def addFacetWithUUID(self, servant: Ice.Object, facet: str) -> Ice.ObjectPrx: ... - def addServantLocator(self, locator: Ice.ServantLocator, category: str) -> None: ... - def addWithUUID(self, servant: Ice.Object) -> Ice.ObjectPrx: ... - def createDirectProxy(self, identity: Ice.Identity) -> Ice.ObjectPrx: ... - def createIndirectProxy(self, identity: Ice.Identity) -> Ice.ObjectPrx: ... - def createProxy(self, identity: Ice.Identity) -> Ice.ObjectPrx: ... + def add(self, servant: Ice.Object, id: Ice.Identity, /) -> Ice.ObjectPrx: ... + def addDefaultServant(self, servant: Ice.Object, category: str, /) -> None: ... + def addFacet(self, servant: Ice.Object, id: Ice.Identity, facet: str, /) -> Ice.ObjectPrx: ... + def addFacetWithUUID(self, servant: Ice.Object, facet: str, /) -> Ice.ObjectPrx: ... + def addServantLocator(self, locator: Ice.ServantLocator, category: str, /) -> None: ... + def addWithUUID(self, servant: Ice.Object, /) -> Ice.ObjectPrx: ... + def createDirectProxy(self, identity: Ice.Identity, /) -> Ice.ObjectPrx: ... + def createIndirectProxy(self, identity: Ice.Identity, /) -> Ice.ObjectPrx: ... + def createProxy(self, identity: Ice.Identity, /) -> Ice.ObjectPrx: ... def deactivate(self) -> None: ... def destroy(self) -> None: ... - def find(self, identity: Ice.Identity) -> Ice.Object | None: ... - def findAllFacets(self, id: Ice.Identity) -> dict[str, Ice.Object]: ... - def findByProxy(self, proxy: Ice.ObjectPrx) -> Ice.Object | None: ... - def findDefaultServant(self, category: str) -> Ice.Object | None: ... - def findFacet(self, id: Ice.Identity, facet: str) -> Ice.Object | None: ... - def findServantLocator(self, category: str) -> Ice.ServantLocator | None: ... + def find(self, identity: Ice.Identity, /) -> Ice.Object | None: ... + def findAllFacets(self, id: Ice.Identity, /) -> dict[str, Ice.Object]: ... + def findByProxy(self, proxy: Ice.ObjectPrx, /) -> Ice.Object | None: ... + def findDefaultServant(self, category: str, /) -> Ice.Object | None: ... + def findFacet(self, id: Ice.Identity, facet: str, /) -> Ice.Object | None: ... + def findServantLocator(self, category: str, /) -> Ice.ServantLocator | None: ... def getCommunicator(self) -> Communicator: ... def getEndpoints(self) -> tuple[Endpoint, ...]: ... def getLocator(self) -> Ice.LocatorPrx | None: ... @@ -531,32 +528,32 @@ class ObjectAdapter: def getPublishedEndpoints(self) -> tuple[Endpoint, ...]: ... def hold(self) -> None: ... def isDeactivated(self) -> bool: ... - def remove(self, id: Ice.Identity) -> Ice.Object: ... - def removeAllFacets(self, id: Ice.Identity) -> dict[str, Ice.Object]: ... - def removeDefaultServant(self, category: str) -> Ice.Object: ... - def removeFacet(self, id: Ice.Identity, facet: str) -> Ice.Object: ... - def removeServantLocator(self, category: str) -> Ice.ServantLocator: ... - def setLocator(self, locator: Ice.LocatorPrx | None) -> None: ... - def setPublishedEndpoints(self, newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) -> None: ... - def waitForDeactivate(self, timeout: int) -> bool: ... - def waitForHold(self, timeout: int) -> bool: ... + def remove(self, id: Ice.Identity, /) -> Ice.Object: ... + def removeAllFacets(self, id: Ice.Identity, /) -> dict[str, Ice.Object]: ... + def removeDefaultServant(self, category: str, /) -> Ice.Object: ... + def removeFacet(self, id: Ice.Identity, facet: str, /) -> Ice.Object: ... + def removeServantLocator(self, category: str, /) -> Ice.ServantLocator: ... + def setLocator(self, locator: Ice.LocatorPrx | None, /) -> None: ... + def setPublishedEndpoints(self, newEndpoints: tuple[Endpoint, ...] | list[Endpoint], /) -> None: ... + def waitForDeactivate(self, timeout: int, /) -> bool: ... + def waitForHold(self, timeout: int, /) -> bool: ... class ObjectPrx: - def __init__(self, communicator: Ice.Communicator, proxyString: str) -> None: ... - def ice_adapterId(self, newAdapterId: str) -> Self: ... + def __init__(self, communicator: Ice.Communicator, proxyString: str, /) -> None: ... + def ice_adapterId(self, newAdapterId: str, /) -> Self: ... def ice_batchDatagram(self) -> Self: ... def ice_batchOneway(self) -> Self: ... - def ice_collocationOptimized(self, collocated: bool) -> Self: ... - def ice_compress(self, compress: bool) -> Self: ... - def ice_connectionCached(self, newCache: bool) -> Self: ... - def ice_connectionId(self, connectionId: str) -> Self: ... - def ice_context(self, new_context: dict[str, str]) -> Self: ... + def ice_collocationOptimized(self, collocated: bool, /) -> Self: ... + def ice_compress(self, compress: bool, /) -> Self: ... + def ice_connectionCached(self, newCache: bool, /) -> Self: ... + def ice_connectionId(self, connectionId: str, /) -> Self: ... + def ice_context(self, new_context: dict[str, str], /) -> Self: ... def ice_datagram(self) -> Self: ... - def ice_encodingVersion(self, version: Ice.EncodingVersion) -> Self: ... - def ice_endpointSelection(self, newType: Ice.EndpointSelectionType) -> Self: ... - def ice_endpoints(self, newEndpoints: tuple[Endpoint, ...] | list[Endpoint]) -> Self: ... - def ice_facet(self, new_facet: str) -> Ice.ObjectPrx: ... - def ice_fixed(self, connection: Ice.Connection) -> Self: ... + def ice_encodingVersion(self, version: Ice.EncodingVersion, /) -> Self: ... + def ice_endpointSelection(self, newType: Ice.EndpointSelectionType, /) -> Self: ... + def ice_endpoints(self, newEndpoints: tuple[Endpoint, ...] | list[Endpoint], /) -> Self: ... + def ice_facet(self, new_facet: str, /) -> Ice.ObjectPrx: ... + def ice_fixed(self, connection: Ice.Connection, /) -> Self: ... def ice_flushBatchRequests(self) -> None: ... def ice_flushBatchRequestsAsync(self) -> Awaitable[None]: ... def ice_getAdapterId(self) -> str: ... @@ -576,8 +573,8 @@ class ObjectPrx: def ice_getLocator(self) -> Ice.LocatorPrx | None: ... def ice_getLocatorCacheTimeout(self) -> int: ... def ice_getRouter(self) -> Ice.RouterPrx | None: ... - def ice_identity(self, newIdentity: Ice.Identity) -> Ice.ObjectPrx: ... - def ice_invocationTimeout(self, timeout: int) -> Self: ... + def ice_identity(self, newIdentity: Ice.Identity, /) -> Ice.ObjectPrx: ... + def ice_invocationTimeout(self, timeout: int, /) -> Self: ... def ice_invoke( self, operation: str, mode: Ice.OperationMode, inParams: bytes, ctx: dict[str, str] | None = None ) -> tuple[bool, bytes]: ... @@ -592,14 +589,14 @@ class ObjectPrx: def ice_isFixed(self) -> bool: ... def ice_isOneway(self) -> bool: ... def ice_isTwoway(self) -> bool: ... - def ice_locator(self, locator: Ice.LocatorPrx | None) -> Self: ... - def ice_locatorCacheTimeout(self, timeout: int) -> Self: ... + def ice_locator(self, locator: Ice.LocatorPrx | None, /) -> Self: ... + def ice_locatorCacheTimeout(self, timeout: int, /) -> Self: ... def ice_oneway(self) -> Self: ... - def ice_router(self, router: Ice.RouterPrx | None) -> Self: ... + def ice_router(self, router: Ice.RouterPrx | None, /) -> Self: ... def ice_toString(self) -> str: ... def ice_twoway(self) -> Self: ... @staticmethod - def newProxy(type: Type[T], proxy: Ice.ObjectPrx) -> T: ... + def newProxy(type: Type[T], proxy: Ice.ObjectPrx, /) -> T: ... def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... def __gt__(self, other: object) -> bool: ... @@ -630,28 +627,29 @@ class Operation: returnType: object, exceptions: tuple, onewayOnly: bool, + /, ) -> None: ... - def invoke(self, proxy: ObjectPrx, args: tuple) -> Any: ... - def invokeAsync(self, proxy: ObjectPrx, args: tuple) -> Awaitable[Any]: ... - def deprecate(self, reason: str): ... + def invoke(self, proxy: ObjectPrx, args: tuple, /) -> Any: ... + def invokeAsync(self, proxy: ObjectPrx, args: tuple, /) -> Awaitable[Any]: ... + def deprecate(self, reason: str, /): ... class Properties: - def __init__(self, args: list[str] | None = None, defaults: Ice.Properties | None = None) -> None: ... - def getProperty(self, key: str) -> str: ... - def getIceProperty(self, key: str) -> str: ... - def getPropertyWithDefault(self, key: str, value: str) -> str: ... - def getPropertyAsInt(self, key: str) -> int: ... - def getIcePropertyAsInt(self, key: str) -> int: ... - def getPropertyAsIntWithDefault(self, key: str, value: int) -> int: ... - def getPropertyAsList(self, key: str) -> list[str]: ... - def getIcePropertyAsList(self, key: str) -> list[str]: ... - def getPropertyAsListWithDefault(self, key: str, value: list[str]) -> list[str]: ... - def getPropertiesForPrefix(self, prefix: str) -> dict[str, str]: ... - def setProperty(self, key: str, value: str) -> None: ... + def __init__(self, args: list[str] | None = None, defaults: Ice.Properties | None = None, /) -> None: ... + def getProperty(self, key: str, /) -> str: ... + def getIceProperty(self, key: str, /) -> str: ... + def getPropertyWithDefault(self, key: str, value: str, /) -> str: ... + def getPropertyAsInt(self, key: str, /) -> int: ... + def getIcePropertyAsInt(self, key: str, /) -> int: ... + def getPropertyAsIntWithDefault(self, key: str, value: int, /) -> int: ... + def getPropertyAsList(self, key: str, /) -> list[str]: ... + def getIcePropertyAsList(self, key: str, /) -> list[str]: ... + def getPropertyAsListWithDefault(self, key: str, value: list[str], /) -> list[str]: ... + def getPropertiesForPrefix(self, prefix: str, /) -> dict[str, str]: ... + def setProperty(self, key: str, value: str, /) -> None: ... def getCommandLineOptions(self) -> list[str]: ... - def parseCommandLineOptions(self, prefix: str, options: list[str]) -> list[str]: ... - def parseIceCommandLineOptions(self, options: list[str]) -> list[str]: ... - def load(self, file: str) -> None: ... + def parseCommandLineOptions(self, prefix: str, options: list[str], /) -> list[str]: ... + def parseIceCommandLineOptions(self, options: list[str], /) -> list[str]: ... + def load(self, file: str, /) -> None: ... def clone(self) -> Properties: ... def __str__(self) -> str: ... @@ -719,27 +717,24 @@ class WSEndpointInfo(EndpointInfo): def stringVersion() -> str: ... def intVersion() -> int: ... -def createProperties(args: list[str] | None = None, defaults: Ice.Properties | None = None) -> Properties: ... -def stringToIdentity(str: str) -> Ice.Identity: ... -def identityToString(identity: Ice.Identity, toStringMode: Ice.ToStringMode | None = None) -> str: ... +def createProperties(args: list[str] | None = None, defaults: Ice.Properties | None = None, /) -> Properties: ... +def stringToIdentity(str: str, /) -> Ice.Identity: ... +def identityToString(identity: Ice.Identity, toStringMode: Ice.ToStringMode | None = None, /) -> str: ... def getProcessLogger() -> Ice.Logger | Logger: ... -def setProcessLogger(logger: Ice.Logger) -> None: ... +def setProcessLogger(logger: Ice.Logger, /) -> None: ... # # Functions to load/compile Slice definitions with 'slice2py'. # -def loadSlice(args: list[str]) -> None: ... -def compileSlice(args: list[str]) -> int: ... +def loadSlice(args: list[str], /) -> None: ... +def compileSlice(args: list[str], /) -> int: ... # # Internal API for IcePy # -def declareProxy(sliceId: str): ... -def defineProxy( - sliceId: str, - proxyType: Type[ObjectPrx], -): ... -def declareValue(sliceId: str): ... +def declareProxy(sliceId: str, /): ... +def defineProxy(sliceId: str, proxyType: Type[ObjectPrx], /): ... +def declareValue(sliceId: str, /): ... def defineValue( sliceId: str, valueType: Type[Ice.Value], @@ -748,14 +743,15 @@ def defineValue( isInterface: bool, baseType: Type[Ice.Value] | None, members: tuple, + /, ): ... -def defineDictionary(sliceId: str, meta: tuple, keyType: TypeInfo, valueType: TypeInfo): ... -def defineEnum(sliceId: str, type: Type, meta: tuple, enumerators: dict): ... +def defineDictionary(sliceId: str, meta: tuple, keyType: TypeInfo, valueType: TypeInfo, /): ... +def defineEnum(sliceId: str, type: Type, meta: tuple, enumerators: dict, /): ... def defineException( - sliceId: str, type: Type[BaseException], meta: tuple, base: Type[BaseException] | None, members: tuple + sliceId: str, type: Type[BaseException], meta: tuple, base: Type[BaseException] | None, members: tuple, / ): ... -def defineSequence(sliceId: str, meta: tuple, elementType: TypeInfo): ... -def defineStruct(sliceId: str, type: Type, meta: tuple, members: tuple): ... +def defineSequence(sliceId: str, meta: tuple, elementType: TypeInfo, /): ... +def defineStruct(sliceId: str, type: Type, meta: tuple, members: tuple, /): ... class TypeInfo: ... From a32866c1f3e808dcd7a790214f3880a188f6d52c Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 14 Aug 2026 16:37:01 +0200 Subject: [PATCH 2/4] Update changelog.d/python/6442.md Co-authored-by: Bernard Normier --- changelog.d/python/6442.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/changelog.d/python/6442.md b/changelog.d/python/6442.md index 936ba249f67..85d4e015f03 100644 --- a/changelog.d/python/6442.md +++ b/changelog.d/python/6442.md @@ -1,3 +1,2 @@ -- Fixed the IcePy stub declaring keyword-capable parameters for functions that accept positional arguments only. - Type checkers accepted calls such as `connection.setAdapter(adapter=None)` that raise `TypeError` at runtime; - the stub and the docstrings now mark these parameters positional-only. +- The documentation and type stub now mark parameters as positional-only for the methods and functions + that accept positional arguments only. From 1c93005694d256a76e0ea053ab088deeddf1a8ea Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 14 Aug 2026 17:01:15 +0200 Subject: [PATCH 3/4] Mark the rich-comparison dunders positional-only as well The rich comparisons on Connection, Endpoint, ImplicitContext, and ObjectPrx are tp_richcompare slot wrappers, so __eq__(other=1) raises TypeError just like the METH_VARARGS methods. This also matches typeshed, which declares object.__eq__ positional-only. --- python/python/IcePy-stubs/__init__.pyi | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/python/python/IcePy-stubs/__init__.pyi b/python/python/IcePy-stubs/__init__.pyi index e3ea0fba493..3297f318b38 100644 --- a/python/python/IcePy-stubs/__init__.pyi +++ b/python/python/IcePy-stubs/__init__.pyi @@ -310,13 +310,13 @@ class Connection: """ ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __gt__(self, other: object) -> bool: ... + def __eq__(self, other: object, /) -> bool: ... + def __ge__(self, other: object, /) -> bool: ... + def __gt__(self, other: object, /) -> bool: ... def __hash__(self) -> int: ... - def __le__(self, other: object) -> bool: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... + def __le__(self, other: object, /) -> bool: ... + def __lt__(self, other: object, /) -> bool: ... + def __ne__(self, other: object, /) -> bool: ... class ConnectionInfo: """ @@ -369,12 +369,12 @@ class Endpoint: """ ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __gt__(self, other: object) -> bool: ... - def __le__(self, other: object) -> bool: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... + def __eq__(self, other: object, /) -> bool: ... + def __ge__(self, other: object, /) -> bool: ... + def __gt__(self, other: object, /) -> bool: ... + def __le__(self, other: object, /) -> bool: ... + def __lt__(self, other: object, /) -> bool: ... + def __ne__(self, other: object, /) -> bool: ... class EndpointInfo: """ @@ -460,12 +460,12 @@ class ImplicitContext: def put(self, key: str, value: str, /) -> str: ... def remove(self, key: str, /) -> str: ... def setContext(self, newContext: dict[str, str], /) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __gt__(self, other: object) -> bool: ... - def __le__(self, other: object) -> bool: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... + def __eq__(self, other: object, /) -> bool: ... + def __ge__(self, other: object, /) -> bool: ... + def __gt__(self, other: object, /) -> bool: ... + def __le__(self, other: object, /) -> bool: ... + def __lt__(self, other: object, /) -> bool: ... + def __ne__(self, other: object, /) -> bool: ... class Logger: def cloneWithPrefix(self, prefix: str, /) -> Logger: ... @@ -597,13 +597,13 @@ class ObjectPrx: def ice_twoway(self) -> Self: ... @staticmethod def newProxy(type: Type[T], proxy: Ice.ObjectPrx, /) -> T: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __gt__(self, other: object) -> bool: ... + def __eq__(self, other: object, /) -> bool: ... + def __ge__(self, other: object, /) -> bool: ... + def __gt__(self, other: object, /) -> bool: ... def __hash__(self) -> int: ... - def __le__(self, other: object) -> bool: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... + def __le__(self, other: object, /) -> bool: ... + def __lt__(self, other: object, /) -> bool: ... + def __ne__(self, other: object, /) -> bool: ... class OpaqueEndpointInfo(EndpointInfo): """Provides access to the details of an opaque endpoint.""" From 2028637b695164218816a7f0f613d261a81a2a57 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 14 Aug 2026 17:31:26 +0200 Subject: [PATCH 4/4] Drop the IcePy changelog entry --- changelog.d/python/6442.md | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 changelog.d/python/6442.md diff --git a/changelog.d/python/6442.md b/changelog.d/python/6442.md deleted file mode 100644 index 85d4e015f03..00000000000 --- a/changelog.d/python/6442.md +++ /dev/null @@ -1,2 +0,0 @@ -- The documentation and type stub now mark parameters as positional-only for the methods and functions - that accept positional arguments only.