<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Cleaning out the inbox: Updated Import pseudo code, filesystems and workingenv</title>
	<atom:link href="http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/feed/" rel="self" type="application/rss+xml" />
	<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/</link>
	<description>python, programming and other things</description>
	<pubDate>Thu, 24 Jul 2008 05:34:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: jesse</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-127</link>
		<dc:creator>jesse</dc:creator>
		<pubDate>Thu, 28 Jun 2007 17:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-127</guid>
		<description>&lt;b&gt;So do you mean for B) that you want to search through all of sys.path, not where all of the matching files are, and then select the last one? Otherwise I don’t quite follow what you are after.&lt;/b&gt;

Yes, that's what I meant - use the last instance of a name in the sys.path rather than the first. Admittedly, this has a lot of problems associated with it and is easily fixed with a sys.path.insert(0, 'path')

As for the rest: I need to dig my heels into PEP304 - ultimately it could be mental dead-end.

As for this...

&lt;b&gt;I would like to know how a sqlite3-backed bytcode cache would perform.&lt;/b&gt; 

So would I :)</description>
		<content:encoded><![CDATA[<p><b>So do you mean for B) that you want to search through all of sys.path, not where all of the matching files are, and then select the last one? Otherwise I don’t quite follow what you are after.</b></p>
<p>Yes, that&#8217;s what I meant - use the last instance of a name in the sys.path rather than the first. Admittedly, this has a lot of problems associated with it and is easily fixed with a sys.path.insert(0, &#8216;path&#8217;)</p>
<p>As for the rest: I need to dig my heels into PEP304 - ultimately it could be mental dead-end.</p>
<p>As for this&#8230;</p>
<p><b>I would like to know how a sqlite3-backed bytcode cache would perform.</b> </p>
<p>So would I :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jesse</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-122</link>
		<dc:creator>jesse</dc:creator>
		<pubDate>Wed, 27 Jun 2007 18:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-122</guid>
		<description>I am going to look into resurrecting this patch and pep. May take me a little time, but I really think something like this would be very useful.</description>
		<content:encoded><![CDATA[<p>I am going to look into resurrecting this patch and pep. May take me a little time, but I really think something like this would be very useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jessenoller.com - Pep 304 followup</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-121</link>
		<dc:creator>jessenoller.com - Pep 304 followup</dc:creator>
		<pubDate>Wed, 27 Jun 2007 18:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-121</guid>
		<description>[...] going to be following up on the comments from Brett and others about python bytecode location for this post as soon as I find sanity again - "Operation Pending Baby 1" has caused a mild for of insanity to set [...]</description>
		<content:encoded><![CDATA[<p>[...] going to be following up on the comments from Brett and others about python bytecode location for this post as soon as I find sanity again - &#8220;Operation Pending Baby 1&#8243; has caused a mild for of insanity to set [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jesse</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-117</link>
		<dc:creator>jesse</dc:creator>
		<pubDate>Tue, 26 Jun 2007 14:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-117</guid>
		<description>Good point Phillip - I will correct my post - I meant to say the $CWD of the script is position 0</description>
		<content:encoded><![CDATA[<p>Good point Phillip - I will correct my post - I meant to say the $CWD of the script is position 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phillip J. Eby</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-116</link>
		<dc:creator>Phillip J. Eby</dc:creator>
		<pubDate>Tue, 26 Jun 2007 14:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-116</guid>
		<description>"""your current working directory is always position 0 on sys.path"""

No, it isn't.  That only happens when you run a -c command or start the interpreter interactively.  When you run a script, *the directory of the script* is what's in position 0 -- which may or may not be the same as the current directory.</description>
		<content:encoded><![CDATA[<p>&#8220;&#8221;"your current working directory is always position 0 on sys.path&#8221;"&#8221;</p>
<p>No, it isn&#8217;t.  That only happens when you run a -c command or start the interpreter interactively.  When you run a script, *the directory of the script* is what&#8217;s in position 0 &#8212; which may or may not be the same as the current directory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Dalke</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-115</link>
		<dc:creator>Andrew Dalke</dc:creator>
		<pubDate>Tue, 26 Jun 2007 11:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-115</guid>
		<description>PEP 304 (http://www.python.org/dev/peps/pep-0304/) "Controlling Generation of Bytecode Files" was meant to control where the .pyc files were stored. I think the conclusion and reason for it being withdrawn was that people didn't need it, there were other ways to solve the problem, and it was too coarse grained.  Eg, see http://mail.python.org/pipermail/python-dev/2005-June/054419.html .

Ah, comment in version control "Authors withdrew some PEPs by mail on python-dev (Apr 26, 2006)."  That's Martin's comment in http://mail.python.org/pipermail/python-dev/2006-April/064395.html which says:

&lt;blockquote&gt;
It's not that the feature is undesirable or the specific
approach at solving the problem - just nobody is interested to work
on it. So future contributors shouldn't get the impression that this
was discussed and rejected, but that it was discussed and abandoned.
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>PEP 304 (http://www.python.org/dev/peps/pep-0304/) &#8220;Controlling Generation of Bytecode Files&#8221; was meant to control where the .pyc files were stored. I think the conclusion and reason for it being withdrawn was that people didn&#8217;t need it, there were other ways to solve the problem, and it was too coarse grained.  Eg, see <a href="http://mail.python.org/pipermail/python-dev/2005-June/054419.html" rel="nofollow">http://mail.python.org/pipermail/python-dev/2005-June/054419.html</a> .</p>
<p>Ah, comment in version control &#8220;Authors withdrew some PEPs by mail on python-dev (Apr 26, 2006).&#8221;  That&#8217;s Martin&#8217;s comment in <a href="http://mail.python.org/pipermail/python-dev/2006-April/064395.html" rel="nofollow">http://mail.python.org/pipermail/python-dev/2006-April/064395.html</a> which says:</p>
<blockquote><p>
It&#8217;s not that the feature is undesirable or the specific<br />
approach at solving the problem - just nobody is interested to work<br />
on it. So future contributors shouldn&#8217;t get the impression that this<br />
was discussed and rejected, but that it was discussed and abandoned.
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-112</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 26 Jun 2007 01:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/2007/06/25/cleaning-out-the-inbox-updated-import-pseudo-code-filesystems-and-workingenv/#comment-112</guid>
		<description>So do you mean for B) that you want to search through all of sys.path, not where all of the matching files are, and then select the last one?  Otherwise I don't quite follow what you are after.

As for the .pyc redirection, that might be doable as an importer/loader (and the rough semantics are already specified in PEP 304).  The trick is making sure that package import is handled properly.  A package might be found at /some/path/, and then you import from /some/path/subpkg/.  But now you need to map that to /tmp._pythonCache/subpkg/ somehow.

Guessing off the top of my head you could just have the importer know it is working with a package, denote the root location where the package is rooted off of sys.path, and then handle the .pyc location as needed.

But now that I think about it, I am not sure how you would be able to signify that a path is a package cleanly.  When you import a package its __path__ entries end up in sys.path_importer_cache just like any other entry on sys.path.  You could find the best suffix on sys.path for the __path__ entry, but what if the path is really different and in no way on sys.path (e.g., tacking on a platform-specific directory on to __path__ and thus has a funky directory location like /some/path/x86/subpkg/)?  So handling package properly becomes tricky.  I guess you could cheat and have the bytecode write out in a naive fashion into the directory (i.e., note the the absolute file name is pkg.subpkg, somehow know that it is an __init__ and not a submodule, and write it to /tmp/._pythonCache/pkg/subpkg/__init__.pyc).

I would like to know how a sqlite3-backed bytcode cache would perform.

Anyway, I have rambled enough on this topic.  =)  I have way too many importers to write know.</description>
		<content:encoded><![CDATA[<p>So do you mean for B) that you want to search through all of sys.path, not where all of the matching files are, and then select the last one?  Otherwise I don&#8217;t quite follow what you are after.</p>
<p>As for the .pyc redirection, that might be doable as an importer/loader (and the rough semantics are already specified in PEP 304).  The trick is making sure that package import is handled properly.  A package might be found at /some/path/, and then you import from /some/path/subpkg/.  But now you need to map that to /tmp._pythonCache/subpkg/ somehow.</p>
<p>Guessing off the top of my head you could just have the importer know it is working with a package, denote the root location where the package is rooted off of sys.path, and then handle the .pyc location as needed.</p>
<p>But now that I think about it, I am not sure how you would be able to signify that a path is a package cleanly.  When you import a package its __path__ entries end up in sys.path_importer_cache just like any other entry on sys.path.  You could find the best suffix on sys.path for the __path__ entry, but what if the path is really different and in no way on sys.path (e.g., tacking on a platform-specific directory on to __path__ and thus has a funky directory location like /some/path/x86/subpkg/)?  So handling package properly becomes tricky.  I guess you could cheat and have the bytecode write out in a naive fashion into the directory (i.e., note the the absolute file name is pkg.subpkg, somehow know that it is an __init__ and not a submodule, and write it to /tmp/._pythonCache/pkg/subpkg/__init__.pyc).</p>
<p>I would like to know how a sqlite3-backed bytcode cache would perform.</p>
<p>Anyway, I have rambled enough on this topic.  =)  I have way too many importers to write know.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
