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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ty-extensions-unofficial
3
- Version: 0.1.0.dev2
3
+ Version: 0.1.0.dev4
4
4
  Summary: A properly packaged fork of the official ty-extensions
5
5
  Author: InSyncWithFoo
6
6
  Author-email: InSyncWithFoo <insyncwithfoo@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ty-extensions-unofficial"
3
- version = "0.1.0.dev2"
3
+ version = "0.1.0.dev4"
4
4
  description = "A properly packaged fork of the official ty-extensions"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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) -> 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.