Skip to content

Commit

Permalink
add Python application notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nosracd committed Nov 18, 2024
1 parent a9c43ec commit c445dde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/content/python-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Python application notes

## Redundant module aliases

At first glance the way that lcm-gen generates an `__init__.py` for the outputted Python module may
seem strange. Symbols are exported using the [redundant alias convention defined by
Python](https://typing.readthedocs.io/en/latest/spec/distributing.html#import-conventions).

This allows tools to see exactly what symbols are exported by the module without having to first
implicitly reexport. For example, consider a module which exported symbols using a convention like
`from .file import Foo` rather than the redundant alias convention of
`from .file import Foo as Foo`. In this case, running `mypy` with `--no-implicit-reexport` would
cause errors like `error: Module "foo" does not explicitly export attribute "Foo" [attr-defined]`.
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Publications and application notes
- `Technical Report MIT-CSAIL-TR-2009-041, Massachusetts Institute of Technology, 2009`
- :ref:`UDP Multicast Setup`
- :ref:`Java application notes`
- :ref:`Python application notes`

Who uses LCM?
=============
Expand Down Expand Up @@ -119,6 +120,7 @@ sending a message to the `mailing list <http://groups.google.com/group/lcm-users
content/install-instructions.md
content/build-instructions.md
content/java-notes.md
content/python-notes.md
content/lcm-type-ref.md
content/log-file-format.md
content/multicast-setup.md
Expand Down

0 comments on commit c445dde

Please sign in to comment.