agronholm / agronholm/typeguard
function compatability check
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 145
- Avg merge
- 8d 12h
- Merged PRs (30d)
- 1
Description
Awesome project, I think it will be very useful.
One question, is there anything that might be used to check the compatibility between two functions?
I am imagining something like this:
```
from typing import List, Any, Sequence
from typeguard import functions_compatible
def f1(var1: int) -> List[int]:
return [var1]
def f2(var1: List[int]) -> Any:
return var1
functions_compatible(f1, f2) # True
functions_compatible(f2, f1) # True, because Any can be int
functions_compatible(f2, f1, strict=True) # False, because Any is not always int
```
I am working on a configurable data pipeline that is meant to run for a very long time, but the exact function connections are not always known until import time or later.
Contributor guide
Assessment
This issue has not been assessed yet.