<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 3/26/10 11:40 AM, Kristján Valur Jónsson wrote:
<blockquote
cite="mid:930F189C8A437347B80DF2C156F7EC7F0A1853A345@exchis.ccp.ad.local"
type="cite">
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal">I just noticed that the stackless module has a
an attribute „stackless“
that points to itself.<o:p></o:p></p>
<p class="MsoNormal">This is highly irregular. I noticed this
because some of
the tests in stackless/test do<o:p></o:p></p>
<p class="MsoNormal">from stackless import *<o:p></o:p></p>
<p class="MsoNormal">and then proceed to do stuff such as<o:p></o:p></p>
<p class="MsoNormal">r = stackless.channel()<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I‘d like to remove this module self reference if
no
one objects.<o:p></o:p></p>
<tt><br>
</tt></div>
</blockquote>
<tt>The purpose of this irregularity was to be able to use<br>
'from stackless import *'<br>
and then to have access to the stackless module, still.<br>
The module is irregular itself, because it has computed<br>
attributes stackless.current and stackless.main.<br>
They were added because they are slightly faster than<br>
stackless.getcurrent() and stackless.getmain().<br>
<br>
This was done in pre-property early days.<br>
I think to remove computed attribute access from the<br>
stackless module, but maybe add a python object<br>
with the name stackless, instead, which has properties<br>
main and current added? This would be very fast with<br>
the new psyco support, which optimizes attribute access.<br>
<br>
Well, I can imagine you won't like that, either.<br>
Feel free to remove stackless.stackless, but then please<br>
also remove the extra attribute access code and make<br>
stackless a real module.<br>
The idea of computed module attributes was related to do<br>
some additions, like having certain checks done, to prevent<br>
overwriting of things and so on, but I don't think I did<br>
much more than considering.<br>
<br>
Btw., I don't like modules very much as they are. They<br>
really should have the layout of a singleton class instance<br>
with full control over attributes.<br>
<br>
And while we are at it: We should also try to get rid of<br>
the flextype module. It was done to provide faster access<br>
to overridable attributes. But I think it is no longer<br>
woth being carried around, and the concept was never<br>
understood by anybody, I think.<br>
<br>
It gives a bit of speedup for overridden methods, still,<br>
but again, in the light of coming psyco for stackless,<br>
this will become irrelevant, because in psyco, all those<br>
method lookups will be resolved at compile time.<br>
<br>
cheers - chris<br>
<br>
</tt>-- <br>
<pre class="moz-signature" cols="72">Christian Tismer :^) <a class="moz-txt-link-rfc2396E" href="mailto:tismer@stackless.com"><mailto:tismer@stackless.com></a>
tismerysoft GmbH : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A : *Starship* <a class="moz-txt-link-freetext" href="http://starship.python.net/">http://starship.python.net/</a>
14109 Berlin : PGP key -> <a class="moz-txt-link-freetext" href="http://wwwkeys.pgp.net/">http://wwwkeys.pgp.net/</a>
work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? <a class="moz-txt-link-freetext" href="http://www.stackless.com/">http://www.stackless.com/</a></pre>
</body>
</html>