07-21, 16:05–16:35 (Europe/Prague), North Hall
Python offers us the ability to customize how it starts up. In some cases arbitrary python code can get executed before the first line of your module is reached. This is necessary for some of its dynamic nature, like virtualenvs but can also be harnessed to make the interpreter experience truly personal.
Python does a lot of work to customize itself when starting up. It also provides hooks for even more customization from users and packages during startup. Some of these are on by default while others must be enabled. Learn how to take advantage of Python's startup to craft a custom interpreter.
Python has a dizzying array of environment variables, many of which are used for startup tuning. The list has grown so long that recent Python versions have split the description of these variables into their own help (--help-env). It is valuable to a Pythonista to know about all of these, but this talk will show you how to use a subset to personalize the Python runtime environment to your development needs and preferences.
As powerful as this customization is, much of it is possible through arbitrary code execution or otherwise manipulating the expected behavior of lookups. Since many of these behaviors happen automatically, it is important to know how to disable them for many reasons: security, reproducibility, and speed among them.
I am a long-time Python developer of over a decade and often focus on static analysis and distribution problems. Python is a diverse and quickly growing community and I love to contribute to it even as I try to keep up. I currently help ActiveState deliver secure, pre-build python projects to enterprise customers and individual developers.