We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a932a5 commit 515f403Copy full SHA for 515f403
imports.py
@@ -96,6 +96,27 @@ def builtin(self):
96
# for compatibility
97
return self.standard()
98
99
+ def implicit(self):
100
+ """
101
+ Is this module implicitly available (based on other conditions)?
102
+
103
+ For example, ``_typeshed`` is made available at runtime by mypy
104
+ and other type checkers and will not have a distribution that
105
+ supplies it.
106
107
+ >>> Import('_typeshed.StrPath').implicit()
108
+ True
109
+ >>> Import('._typeshed').implicit()
110
+ False
111
+ >>> Import('os').implicit()
112
113
114
+ implicit = {'_typeshed'}
115
+ return self.top in implicit
116
117
+ def excluded(self):
118
+ return self.implicit() or self.standard()
119
120
CPE = jaraco.context.ExceptionTrap(subprocess.CalledProcessError)
121
122
@staticmethod
0 commit comments