-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters