Skip to content

Commit e56edb7

Browse files
authored
Add __all__ to specify public API (#46)
1 parent 28f9b16 commit e56edb7

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- `__all__` to let type checkers know what is part of the public API. (by [@alkatar21](https://github.com/alkatar21) in [#46])
13+
1014
## [1.3.1] - 2022-10-06
1115

1216
### Added
@@ -73,3 +77,4 @@ Initial version of `codetiming`. Version 1.0.0 corresponds to the code in the tu
7377
[#34]: https://github.com/realpython/codetiming/pull/34
7478
[#35]: https://github.com/realpython/codetiming/pull/35
7579
[#38]: https://github.com/realpython/codetiming/pull/38
80+
[#46]: https://github.com/realpython/codetiming/pull/46

codetiming/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def stuff():
2222
"""
2323

2424
# Codetiming imports
25-
from codetiming._timer import Timer, TimerError # noqa
25+
from codetiming._timer import Timer, TimerError
26+
27+
# Use __all__ to let type checkers know what is part of the public API.
28+
__all__ = ["Timer", "TimerError"]
2629

2730
# Versioning is handled by bump2version
2831
__version__ = "1.3.1"

0 commit comments

Comments
 (0)