Yonatan Zunger wrote: > I had a similar recent need, with a bit more on top of it, and solved it > with this slightly insane library. (Alas, I haven't figured out a good way > to make it act as a true subtype of UnderlyingType yet) > > (...)
To me, your trick seems to address a different problem. You want context variables to be transparent and behave themselves as the data that they hold (in C++ terms: you want reference semantics instead of pointer semantics). This trick might be necessary at some times (like your example of replacing sys.stdout with a context var), but I consider it dangerous for general usage. Python-Ideas mailing list -- python-dev(a)python.org To unsubscribe send an email to python-ideas-leave(a)python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/