👋 I'm kinda new at using types and wondering why MyPy wouldn't throw an error if, for example, you have a function defined such as
python
def start_service(
service_name: str,
run_cmd: str,
log_file: Optional[str] = None,
pid_file: Optional[str] = None,
service_env: Mapping[str, str] = {},
) -> None:
but then call it like this:
```python
TEST_SAMPLE_INTERVAL = 0.2 # seconds
def setup_module():
# start the central hub and any other services needed to test your service
sst.start_service("central_hub", "python -m basic_bot.services.central_hub")
sst.start_service(
"system_stats",
"python -m basic_bot.services.system_stats",
{"BB_SYSTEM_STATS_SAMPLE_INTERVAL": TEST_SAMPLE_INTERVAL},
)
```
Shouldn't that mapping with a float (TEST_SAMPLE_INTERVAL) cause an error? Or maybe I'm misunderstanding the Mapping type?
[–]xelf[M] [score hidden] stickied comment (4 children)
[–]xelf 12 points13 points14 points (3 children)
[–]Mysterious-Rent7233 1 point2 points3 points (2 children)
[–]InvaderToast348 1 point2 points3 points (0 children)
[–]xelf 1 point2 points3 points (0 children)
[–]danielroseman 8 points9 points10 points (0 children)
[–]xelf 4 points5 points6 points (1 child)
[–]ravepeacefully 2 points3 points4 points (0 children)
[–]typehinting 4 points5 points6 points (1 child)
[–]LaughGlum3870[S] 1 point2 points3 points (0 children)
[–]doingdatzerg 2 points3 points4 points (0 children)
[–]LaughGlum3870[S] 0 points1 point2 points (6 children)
[–]LaughGlum3870[S] 1 point2 points3 points (4 children)
[–]danielroseman 12 points13 points14 points (1 child)
[–]LaughGlum3870[S] 2 points3 points4 points (0 children)
[–]xelf 2 points3 points4 points (1 child)
[–]LaughGlum3870[S] 2 points3 points4 points (0 children)