-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Quantity as Generic class - Add overloaded signature for __new__ Quantity - Add typing module as private - Add py.typed for PEP561 supports - Add overloaded signature for __new__ Quantity - Quantity as Generic class - Add type hints throughout the project - Add py.typed in package data in setup.cfg - Add type hints for decorators - Add type hints for public API of registry.py - Add type hints for units.py
- Loading branch information
Showing
13 changed files
with
529 additions
and
230 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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
[run] | ||
omit = pint/testsuite/* | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
AbstractMethodError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if TYPE_CHECKING: |
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
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,18 @@ | ||
from typing import TYPE_CHECKING, Any, Callable, Tuple, TypeVar, Union | ||
|
||
if TYPE_CHECKING: | ||
from .quantity import Quantity | ||
from .unit import Unit | ||
from .util import UnitsContainer | ||
|
||
UnitLike = Union[str, "UnitsContainer", "Unit"] | ||
|
||
QuantityOrUnitLike = Union["Quantity", UnitLike] | ||
|
||
Shape = Tuple[int, ...] | ||
|
||
_MagnitudeType = TypeVar("_MagnitudeType") | ||
S = TypeVar("S") | ||
|
||
FuncType = Callable[..., Any] | ||
F = TypeVar("F", bound=FuncType) |
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
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
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
Empty file.
Oops, something went wrong.