<br><br><div class="gmail_quote">On 10 January 2011 11:26, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Mon, Jan 10, 2011 at 11:11 AM, Ron Adam <<a href="mailto:rrr@ronadam.com">rrr@ronadam.com</a>> wrote:<br>
> On the python side of things, the attributes we've been discussing almost<br>
> never have anything to do with what most programs are written to do. Unless<br>
> it's a program written specifically for managing pythons various parts. It's<br>
> kind of like the problem of separating content, context, and presentation in<br>
> web pages.  Sometimes it's hard to do.<br>
<br>
</div>Yep - 99.99% of python code will never care if this is ever fixed.<br>
However, the fact that we've started using acceleration modules and<br>
pseudo-packages in the standard library means that "things should just<br>
work" is being broken subtly in the stuff we're shipping ourselves<br>
(either by creating pickling problems, as in unittest, or misleading<br>
introspection results, as in functools and datetime).<br>
<br>
And if we're going to fix it at all, we may as well fix it right :)<br>
<div class="im"><br></div></blockquote><div><br>I certainly don't object to fixing this, and neither do I object to adding a new class / module / function attribute to achieve it.<br><br>However... is there anything else that this fixes? (Are there more examples "in the wild" where this would help?)<br>
<br>The unittest problem with pickling is real but likely to only affect a very, very small number of users. The introspection problem (getsource) for functools and datetime isn't a *real* problem because the source code isn't available. If in fact getsource now points to the pure Python version even in the cases where the C versions are being used then "fixing" this seems like a step backwards...<br>
<br><br>Python 3.2:<br>>>> import inspect<br>>>> from datetime import date<br>>>> inspect.getsource(date)<br>'class date:\n    """Concrete date type.\n\n ...'<br><br>Python 3.1:<br>
>>> import inspect<br>>>> from datetime import date<br>>>> inspect.getsource(date)<br>Traceback (most recent call last):<br>  ...<br>IOError: source code not available<br><br>With your changes in place would Python 3.3 revert to the 3.1 behaviour here? How is this an advantage?<br>
<br>What I'm really asking is, is the cure (and the accompanying implementation effort and additional complexity to the Python object model) worse than the disease...<br><br>All the best,<br><br>Michael Foord<br><br><br>
<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>