MCPcopy Index your code
hub / github.com/RustPython/RustPython / foo

Method foo

Lib/test/test_typing.py:7975–7979  ·  view source on GitHub ↗
(a: A)

Source from the content-addressed store, hash-verified

7973 A = Optional[Type[BaseException]]
7974
7975 def foo(a: A) -> Optional[BaseException]:
7976 if a is None:
7977 return None
7978 else:
7979 return a()
7980
7981 self.assertIsInstance(foo(KeyboardInterrupt), KeyboardInterrupt)
7982 self.assertIsNone(foo(None))

Callers

nothing calls this directly

Calls 1

aClass · 0.70

Tested by

no test coverage detected