Skip to content
Back to top
View this page

# Style guide

## Variable naming

- Use `UPPERCASE` names for module-level constants, or class-level attributes.

- Use `lowercase` names for module-level variables, or instance-level attributes, or methods in general.

- Use names prefixed by an underscore `_` for protected attributes, both class-level and instance-level.

- Suffix `Enum` subclasses and ClassEnum with `...Enum`.

  Todo

  This runs counter to Python’s intended naming scheme, where `...Enum` implies that something is an enum metaclass.

  Maybe it could be changed?

- Suffix ClassMemberBase with `...Base`.

  Todo

  This feels a bit odd to write, especially when doing typing.

  A `type`[`ItemBase`] is the kind of an item, an `ItemBase` is a stack?

  Maybe that could be changed, too?

Todo

Decide on when to use `Pack...` and `World...` prefixes, and when to avoid them.

## Module organization

Todo

Fully develop the hierarchy describing which classes go where with no ambiguity.

## Documentation

- Follow the Python Developer’s Guide for documenting sections.

- Either use `:caption:` to document the context of `.. code-block`, or, alternatively, wrap it in a `.. admonition:: Example` if applicable.