SeleniumLibrary keywords via Python

This is not good solution either because it leaves the typing information away from the method signature. SeleniumLibrary currently does not have any typing information, but the aim is to have all that done in the 5.0 release. Also the stub file should be correct in syntax point of view. I need to think what would be good solution.

Why do you say, that the typing is left?

Libdoc knows type hints and also RobotFramework does automatic type conversion. So it shall be available through dynamic lib core.

@aaltat
Tatu,
I really think this could be a real improvement of PythonLibCore. And like RobotFramework i would try to reduce external dependencies as far as possible.

This situation looks quite easy to solve. If PythonLibCore just offers this small Script, so that a developer can generate the __init__.pyi before packaging, or the end user could just call it. Without any dependencies.
And even if the type hints would be missing it would be a proper solution!

SL has never shared the goal of the minimal dependencies with core Robot Framework, plus MyPy dependency is needed only in the build/development time and will MyPy is not needed when installing SeleniumLibrary. The plan is to include stub file in the SL package when doing a next release.

Although it is stub file, it still needs to be valid Python, meaning id I have def keyword(self, argument : Union[Dict, None]): those Union and Dict imports must be available in the stub files. Also my understanding about the stub file is that it should not be created in runtime, instead it should be part of package (in separate or in the same package.)

The PythonLibCore has the required information, just not in that usable format in some cases. Well need to think about it and how to solve the import problem.

At least in my case, I’ve never gotten type hints to do proper type conversion in ST.