From 199abc980c347383cb1164cc3224f59a1286eda6 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 16 Sep 2015 12:36:01 -0700 Subject: [PATCH] Add paragraph about builtins vs stdlib. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 729811881..eed5946c5 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,19 @@ class date(object): def weekday(self) -> int: ... ``` +## About builtins vs stdlib + +C extensions that are built into Python (E.g. sys, array, math, signal, ...) have +higher precedence in the import path than modules that ship with Python but +are not built into the python binary (like os.py, glob.py, zipfile.py etc.; +but also some C extensions like datetime). The +former are implicitly prepended to the start of your PYTHONPATH, whereas the +latter are implicitly appended to it. + +Typeshed doesn't explicitly distinguish between the two module types. For a specific +Python build, you can use `sys.builtin_module_names` to query which modules +are built in and set import priority accordingly. + ## Contributions We're welcoming contributions (pull requests) for types of third party