<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 5, 2014 at 2:09 PM, Benjamin Peterson <span dir="ltr"><<a href="mailto:benjamin@python.org" target="_blank">benjamin@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Neil Girdhar <mistersheik@...> writes:<br>
<br>
><br>
> Many classes, functions, and modules are defined within the context of<br>
another class, function, or module thereby forming a mathematical forest of<br>
declarations.  It is possible to walk the descendants using __dict__ (for<br>
classes and modules), but not the ancestors.  I propose adding __parent__<br>
that would be filled at the same time that __qualname__ is filled in.<br>
<br>
</span>This is unlikely to work.<br>
<br>
1) It turns basically everything into a cycle.<br></blockquote><div><br></div><div>Why a cycle? </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) __qualname__ is determined strictly from syntax, whereas __parent__ could<br>
not be. For example, what happens if I take a method from one class and set<br>
it on another? __parent__ would not be well-defined.<br></blockquote><div><br></div><div>I'm suggesting that parent be determined purely from declaration.  If you copy something, neither qualname nor parent would change unless you change them. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards,<br>
Benjamin<br>
<br>
<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/94fTkAkjhCo/unsubscribe" target="_blank">https://groups.google.com/d/topic/python-ideas/94fTkAkjhCo/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas%2Bunsubscribe@googlegroups.com">python-ideas+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
</font></span></blockquote></div><br></div></div>