lyx2lyx: many unused variables (any bugs?)
Thibaut Cuvelier
dourouc05 at gmail.com
Thu Dec 8 21:27:38 UTC 2022
On Thu, 8 Dec 2022 at 22:06, José Matos <jaomatos at gmail.com> wrote:
> On the same vein for 2.5 I intend to start, in an iterative process, to
> add type hinting to our python code: http://mypy-lang.org/
>
> One example:
>
> def fib(n):
> if n==0 or n==1:
> return 1
> else:
> return fin(n-1)+fib(n-2)
>
> becomes
>
> def fib(n: int) -> int:
> if n==0 or n==1:
> return 1
> else:
> return fin(n-1)+fib(n-2)
>
> The code works the same in both cases but we can use static type
> checking to ensure that functions are called as intended.
>
> This checking is not done at running time. Instead it can be run in a
> test stage, like pylint that Scott suggests.
>
The only problem I see with type hints is that it restricts the versions of
Python that can run the code. I believe that anything below 3.5
<https://lwn.net/Articles/640359/> won't be able to even parse the Python
code (which excludes 2.7). I understood that Python 2.7 should no longer be
supported with LyX 2.5, I don't remember anything about 3.x.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221208/e23e20a6/attachment.html>
More information about the lyx-devel
mailing list