Closed tochilinak closed 1 year ago
Added support for such protocols:
class SupportsCall(Protocol): def __call__(self, *args, **kwargs): ... class HasF(Protocol): f: SupportsCall class SupportsSpecificCall(Protocol): def __call__(self, *args, **kwargs) -> HasF: ... class HasSpecificF(Protocol): f: SupportsSpecificCall
Example of class that supports HasF but not HasSpecificF:
HasF
HasSpecificF
class S: def f(self, x: Union[int, str]) -> collections.Counter: return collections.Counter([x])
Example of class that supports HasSpecificF:
class RImpl: def f(self) -> 'RImpl': return self
utbot-python-types/src/test/kotlin/org/utbot/python/newtyping/PythonSubtypeCheckerTest.kt
testSupportsCall
testSupportsSpecificCall
Check off the item if the statement is true. Hint: [x] is a marked item.
Please do not delete the list or its items.
Description
Added support for such protocols:
Example of class that supports
HasF
but notHasSpecificF
:Example of class that supports
HasSpecificF
:How to test
Automated tests
utbot-python-types/src/test/kotlin/org/utbot/python/newtyping/PythonSubtypeCheckerTest.kt
:testSupportsCall
testSupportsSpecificCall
Self-check list
Check off the item if the statement is true. Hint: [x] is a marked item.
Please do not delete the list or its items.