ty-extensions-unofficial 0.1.0.dev2__tar.gz → 0.1.0.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/PKG-INFO +1 -1
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/pyproject.toml +1 -1
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/src/ty_extensions/__init__.pyi +22 -1
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/README.md +0 -0
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/src/ty_extensions/__init__.py +0 -0
- {ty_extensions_unofficial-0.1.0.dev2 → ty_extensions_unofficial-0.1.0.dev4}/src/ty_extensions/py.typed +0 -0
|
@@ -91,6 +91,23 @@ class ConstraintSet:
|
|
|
91
91
|
def __or__(self, other: ConstraintSet) -> ConstraintSet: ...
|
|
92
92
|
def __invert__(self) -> ConstraintSet: ...
|
|
93
93
|
|
|
94
|
+
class GenericContext:
|
|
95
|
+
"""
|
|
96
|
+
The set of typevars that are bound by a generic class, function, or type
|
|
97
|
+
alias.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
def specialize_constrained(
|
|
101
|
+
self, constraints: ConstraintSet
|
|
102
|
+
) -> Specialization | None:
|
|
103
|
+
"""
|
|
104
|
+
Returns a specialization of this generic context that satisfies the
|
|
105
|
+
given constraints, or None if the constraints cannot be satisfied.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
class Specialization:
|
|
109
|
+
"""A mapping of typevars to specific types"""
|
|
110
|
+
|
|
94
111
|
# Predicates on types
|
|
95
112
|
#
|
|
96
113
|
# Ideally, these would be annotated using `TypeForm`, but that has not been
|
|
@@ -128,7 +145,11 @@ def is_single_valued(ty: Any) -> bool:
|
|
|
128
145
|
|
|
129
146
|
# Returns the generic context of a type as a tuple of typevars, or `None` if the
|
|
130
147
|
# type is not generic.
|
|
131
|
-
def generic_context(ty: Any) ->
|
|
148
|
+
def generic_context(ty: Any) -> GenericContext | None: ...
|
|
149
|
+
|
|
150
|
+
# Converts a value into a `Callable`, if possible. This is the value equivalent
|
|
151
|
+
# of `CallableTypeOf`, which operates on types.
|
|
152
|
+
def into_callable(ty: Any) -> Any: ...
|
|
132
153
|
|
|
133
154
|
# Returns the `__all__` names of a module as a tuple of sorted strings, or `None` if
|
|
134
155
|
# either the module does not have `__all__` or it has invalid elements.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|