You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec-draft.rst
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,3 +309,9 @@ Ideas:
309
309
2. Use something other than ``type name =`` to do this. Like, ``name = associated_type(N)`` and have that be a descriptor.
310
310
3. Add a decorator or base class that replaces the GenericTypeAliases with the descriptor from above.
311
311
4. Make ``GenericTypeAlias`` a descriptor (do the above for testing).
312
+
313
+
UPDATE: None of this works except maybe the first one, because the descriptor will get called on the *origin class* and not the instantiated ``_GenericAlias``.
314
+
315
+
We could probably kind of make it work by having a descriptor and having the descriptor *walk the stack* and get the ``self`` from the ``_BaseGenericAlias.__getattr__`` stack frame but that is a horror show...
316
+
317
+
Yury thinks we don't want to propose anything that requires much modifying of the descriptors...
0 commit comments