Skip to content

Commit 713a599

Browse files
committed
Update: this doesn't work
1 parent f69f4c7 commit 713a599

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

spec-draft.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,9 @@ Ideas:
309309
2. Use something other than ``type name =`` to do this. Like, ``name = associated_type(N)`` and have that be a descriptor.
310310
3. Add a decorator or base class that replaces the GenericTypeAliases with the descriptor from above.
311311
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

Comments
 (0)