pypdfium2-team / ctypesgen

Wrapper generator for Python ctypes
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Start using assignment expressions (:= aka walrus operator) #7

Open mara004 opened 5 months ago

mara004 commented 5 months ago

There doesn't seem to be any real need yet, but it might be nice to have and get started with from a code style POV.

Yet, I believe otherwise the codebase itself might still be compatible with versions below 3.7, like maybe >= 3.4 or something, so this might yet be a bit of a concern. I believe opensuse leap still ships 3.6 ...

mara004 commented 5 months ago

Note to self: comparison is corrupt due to a force repush of a commit on the pypdfium2 branch. Need to update the py38_walrus branch accordingly.

mara004 commented 5 months ago

There's also https://github.com/pypdfium2-team/ctypesgen/blob/c08b0cb3ec07e5b9d815d6c20235d8e1c72a0208/src/ctypesgen/printer_python/printer.py#L70-L71 where we could cache Path.cwd() locally by assignment expression.