Skip to content

Conversation

@anton-ubi
Copy link
Contributor

@anton-ubi anton-ubi commented Nov 6, 2025

Summary.
Surface cleanup and typing annotation of the layer module.

Changes

  • remove spotted python-2 artifacts (objects, with_metaclass, super with args)
  • use super() when possible
  • use f-string when meaningful
  • add typing annotations when non ambiguous
  • explicit a bit more what parameters are actually hidden behind Layer object kwargs
  • Correct typo and grammar in docstrings and comments
  • Add new LayerType enum to represent Layer types (render, util, post)
  • Add Layer string and repr representation

Rational

  • Type annotations: The main goal is to enable better auto-completion when outlining layers. Prior to that PR, it is very difficult to know in advance the name and type of the parameters accepted by a Layer object.
  • LayerType enum: easier access to the available type values. Same as for typing annotations: we can now benefit of the auto-completion to know which types exist.
  • The rest is mostly house-cleaning to keep up, especially since we dropped python2.

Note to reviewers
PR can be reviewed per commit for smaller scoped diffs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant