Home / Function/ is_gen_callable() — fastapi Function Reference

is_gen_callable() — fastapi Function Reference

Architecture documentation for the is_gen_callable() function in models.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  6f587fbc_eb49_f9f0_143e_7c8f60bbc310["is_gen_callable()"]
  575d42b6_61a5_5351_210d_0e7a8dd0084f["Dependant"]
  6f587fbc_eb49_f9f0_143e_7c8f60bbc310 -->|defined in| 575d42b6_61a5_5351_210d_0e7a8dd0084f
  8fd8a24b_4153_63d9_a368_0de559b55839["_impartial()"]
  6f587fbc_eb49_f9f0_143e_7c8f60bbc310 -->|calls| 8fd8a24b_4153_63d9_a368_0de559b55839
  1e3f2d0b_134b_ca9f_27b7_1847fce256de["_unwrapped_call()"]
  6f587fbc_eb49_f9f0_143e_7c8f60bbc310 -->|calls| 1e3f2d0b_134b_ca9f_27b7_1847fce256de
  style 6f587fbc_eb49_f9f0_143e_7c8f60bbc310 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/dependencies/models.py lines 106–129

    def is_gen_callable(self) -> bool:
        if self.call is None:
            return False  # pragma: no cover
        if inspect.isgeneratorfunction(
            _impartial(self.call)
        ) or inspect.isgeneratorfunction(_unwrapped_call(self.call)):
            return True
        if inspect.isclass(_unwrapped_call(self.call)):
            return False
        dunder_call = getattr(_impartial(self.call), "__call__", None)  # noqa: B004
        if dunder_call is None:
            return False  # pragma: no cover
        if inspect.isgeneratorfunction(
            _impartial(dunder_call)
        ) or inspect.isgeneratorfunction(_unwrapped_call(dunder_call)):
            return True
        dunder_unwrapped_call = getattr(_unwrapped_call(self.call), "__call__", None)  # noqa: B004
        if dunder_unwrapped_call is None:
            return False  # pragma: no cover
        if inspect.isgeneratorfunction(
            _impartial(dunder_unwrapped_call)
        ) or inspect.isgeneratorfunction(_unwrapped_call(dunder_unwrapped_call)):
            return True
        return False

Subdomains

Frequently Asked Questions

What does is_gen_callable() do?
is_gen_callable() is a function in the fastapi codebase, defined in fastapi/dependencies/models.py.
Where is is_gen_callable() defined?
is_gen_callable() is defined in fastapi/dependencies/models.py at line 106.
What does is_gen_callable() call?
is_gen_callable() calls 2 function(s): _impartial, _unwrapped_call.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free