MCPcopy
hub / github.com/python-attrs/attrs / get_generic_base

Function get_generic_base

src/attr/_compat.py:95–99  ·  src/attr/_compat.py::get_generic_base

If this is a generic class (A[str]), return the generic base for it.

(cl)

Source from the content-addressed store, hash-verified

93
94
95def get_generic_base(cl):
96 class="st">""class="st">"If this is a generic class (A[str]), return the generic base for it."class="st">""
97 if cl.__class__ is _GenericAlias:
98 return cl.__origin__
99 return None

Callers 2

fieldsFunction · 0.85
hasFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected