We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b039f4e commit 23cbd6bCopy full SHA for 23cbd6b
src/variants/inspect.py
@@ -0,0 +1,25 @@
1
+# -*- coding: utf-8 -*-
2
+"""
3
+Provides inspection tools for extracting metadata from function groups.
4
5
+from ._variants import VariantFunction, VariantMethod
6
+
7
+if False: # pragma: nocover
8
+ from typing import Any # NOQA
9
10
11
+def is_primary(f):
12
+ # type: (Any) -> bool
13
+ """
14
+ Detect if a function is a primary function in a variant group
15
16
+ return isinstance(f, (VariantFunction, VariantMethod))
17
18
19
+def is_primary_method(f):
20
21
22
+ Detect if a function is a primary method in a variant group
23
24
+ return isinstance(f, VariantMethod)
25
0 commit comments