<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Import on Shai Asher</title><link>https://slow-is-smooth.io/tags/import/</link><description>Recent content in Import on Shai Asher</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 21 Jun 2020 09:00:00 +0300</lastBuildDate><atom:link href="https://slow-is-smooth.io/tags/import/index.xml" rel="self" type="application/rss+xml"/><item><title>Importing Is Executing</title><link>https://slow-is-smooth.io/blog/importing-is-executing/</link><pubDate>Sun, 21 Jun 2020 09:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/importing-is-executing/</guid><description>&lt;p&gt;Python 3.8 makes 479 system calls to run a program that does nothing, and imports 34 modules before&#10;the program&amp;rsquo;s first line. &lt;code&gt;import json&lt;/code&gt; adds about 270 more calls. Put 100 directories on&#10;&lt;code&gt;PYTHONPATH&lt;/code&gt; and the same &lt;code&gt;import json&lt;/code&gt; makes 4,372, and on Python 2.7 18,469, of which 17,705 fail,&#10;because Python 2 asks the file system for every name it might be looking for in every directory it&#10;might be in. And the bytecode it finds at the end of that search is trusted on the strength of two&#10;numbers, the source file&amp;rsquo;s modification time and its size: change a file without changing either and&#10;Python keeps running the old code.&lt;/p&gt;</description></item></channel></rss>