Seguir

peeps, is there a good overview of modern python practices? Types, tests, coverage, etc?

Orca, the screenreader, could use a lot of help with modernizing its code base.

@federicomena I always recommend this tutorial:
pycon.switowski.com/
The covers all the basics from setting up the IDE (VS Code in this case, but can mostly be replaced by VSCodium) to documenting and deploying an app.

@federicomena (I've just read the thing about you being one of the creators of GNOME and I'm completely geeking out.) :gnome:

@federicomena well I think aside some blogs, python best practices are "copy everything from a project you love" 😅

@federicomena
Black & Mypy are always a good place to start, and of course editor/tools often integrate with them (and can make your life much easier)

Sadly PyGObject can't provide type info, which can limit you a bit

@federicomena I'm not entirely sure of the practicalities, we may need to make a mypy plug-in

Sadly PyGObject doesn't seem to get much attention these days :-(

@zbrown oh, wait, I'm thinking in terms of generating a binding statically with python type annotations, but that's not how it works...

@federicomena

Python does have "stubs" that provide metadata for untyped modules (indeed the stdlib is handled that way) or native/blackbox modules that otherwise couldn't be introspected

Some have sorta tried that for PyGObject, but the problem of course is that we don't really have a static API to provide static stubs for — different people have different versions of differents sets of GIRs

@federicomena so we'd probably need to either implement it in the type checker itself (as SQLAlchemy does for ORM stuff), or maybe add a checking mode to PyGObject itself (ultimately the metadata is "just" strings in a magic field)

@zbrown I think I'll have to learn a lot about Python to be useful in Orca-land... this is all really interesting; thanks for explaining.

Regístrate para participar en la conversación
MaSToDoN.MX

La red social del futuro: ¡Sin anuncios, sin vigilancia corporativa, diseño ético, y descentralización! ¡Sé dueño de tu información con Mastodon!